17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 10:12:24 +01:00

fix: the bugs and vulnerabilities SonarCloud reports on PR #216

This commit is contained in:
2026-11-07 22:11:08 +01:00
parent 8e85def98f
commit 7667e5b2ec
65 changed files with 910 additions and 121 deletions

View File

@@ -246,7 +246,10 @@ span_result solve_span( network_type const &Type, span_input const &Input, doubl
{
auto nodes { messenger.nodes() };
auto const step { std::max( 0.1, Samplestep ) };
for( double x = step; x < length; x += step ) { nodes.push_back( x ); }
{
double x { step };
while( x < length ) { nodes.push_back( x ); x += step; }
}
std::sort( nodes.begin(), nodes.end() );
nodes.erase( std::unique( nodes.begin(), nodes.end(), []( double L, double R ) { return std::abs( L - R ) < 1e-6; } ), nodes.end() );
for( auto const x : nodes ) {