diff --git a/common/hash_eda.cpp b/common/hash_eda.cpp index 5423e239c7..d0b52f237a 100644 --- a/common/hash_eda.cpp +++ b/common/hash_eda.cpp @@ -35,6 +35,8 @@ #include #include +#include +#include #include @@ -70,11 +72,18 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags ) if( aFlags & HASH_ROT ) hash_combine( ret, footprint->GetOrientation().AsDegrees() ); + std::vector hashes; + for( BOARD_ITEM* item : footprint->GraphicalItems() ) - hash_combine( ret, hash_fp_item( item, aFlags ) ); + hashes.push_back( hash_fp_item( item, aFlags ) ); for( PAD* pad : footprint->Pads() ) - hash_combine( ret, hash_fp_item( static_cast( pad ), aFlags ) ); + hashes.push_back( hash_fp_item( static_cast( pad ), aFlags ) ); + + std::sort( hashes.begin(), hashes.end() ); + + for( size_t h : hashes ) + hash_combine( ret, h ); } break;