Replace custom Clamp with std::clamp

Fixes bug in parser that had the elements in the wrong order due to our
custom version not matching the standard order
This commit is contained in:
Seth Hillbrand
2024-07-25 19:17:17 +02:00
parent 3f3505570a
commit 69849ba3ca
15 changed files with 48 additions and 65 deletions
+2 -3
View File
@@ -27,10 +27,9 @@
#include <cassert>
#include <cstdarg>
#include <iostream> // for string, endl, basic_ost...
#include <stddef.h> // for size_t
#include <cstddef> // for size_t
#include <core/arraydim.h>
#include <math/util.h> // for Clamp
#include <layer_ids.h> // for PCB_LAYER_ID
#include <lseq.h>
#include <macros.h> // for arrayDim
@@ -742,7 +741,7 @@ LSET LSET::AllCuMask( int aCuLayerCount )
LSET ret = all;
int clear_count = MAX_CU_LAYERS - aCuLayerCount;
clear_count = Clamp( 0, clear_count, MAX_CU_LAYERS - 2 );
clear_count = std::clamp( clear_count, 0, MAX_CU_LAYERS - 2 );
for( int elem = In30_Cu; clear_count; --elem, --clear_count )
ret.set( elem, false );