diff --git a/common/lset.cpp b/common/lset.cpp index 7e0c67d9cd..a7765468d9 100644 --- a/common/lset.cpp +++ b/common/lset.cpp @@ -560,10 +560,10 @@ const LSET& LSET::BackAssembly() const LSET& LSET::InternalCuMask() { static LSET saved( { In1_Cu, In2_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, - In7_Cu, In8_Cu, In9_Cu, In10_Cu, In11_Cu, In12_Cu, - In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, - In19_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, - In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In30_Cu } ); + In7_Cu, In8_Cu, In9_Cu, In10_Cu, In11_Cu, In12_Cu, + In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, + In19_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, + In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In30_Cu } ); return saved; } @@ -581,20 +581,18 @@ LSET allCuMask( int aCuLayerCount ) LSET LSET::AllCuMask( int aCuLayerCount ) { - static LSET savedMax = allCuMask( MAX_CU_LAYERS ); - static LSET cache; - static int cacheCuLayerCount = -1; - if( aCuLayerCount == MAX_CU_LAYERS ) - return savedMax; + return AllCuMask(); - if( aCuLayerCount != cacheCuLayerCount ) - { - cache = allCuMask( aCuLayerCount ); - cacheCuLayerCount = aCuLayerCount; - } + return allCuMask( aCuLayerCount ); +} + + +LSET LSET::AllCuMask() +{ + static LSET s_savedMax = allCuMask( MAX_CU_LAYERS ); - return cache; + return s_savedMax; } diff --git a/include/lset.h b/include/lset.h index 4ab472b80c..b0f4d6b4c8 100644 --- a/include/lset.h +++ b/include/lset.h @@ -117,7 +117,12 @@ public: /** * Return a mask holding the requested number of Cu PCB_LAYER_IDs. */ - static LSET AllCuMask( int aCuLayerCount = MAX_CU_LAYERS ); + static LSET AllCuMask( int aCuLayerCount ); + + /** + * return AllCuMask( MAX_CU_LAYERS ); + */ + static LSET AllCuMask(); /** * Return a mask holding the Front and Bottom layers.