Skip to content

Commit 554e6e1

Browse files
fix: Remove potential non-determinism in relationship ordering.
1 parent c7c31bc commit 554e6e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scip_indexer/SCIPSymbolRef.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
#include "absl/strings/str_replace.h"
1111
#include "spdlog/fmt/fmt.h"
1212

13+
#include "common/sort.h"
1314
#include "core/Loc.h"
1415
#include "main/lsp/lsp.h"
1516

1617
#include "scip_indexer/Debug.h"
18+
#include "scip_indexer/SCIPProtoExt.h"
1719
#include "scip_indexer/SCIPSymbolRef.h"
1820

1921
using namespace std;
@@ -143,6 +145,8 @@ void UntypedGenericSymbolRef::saveRelationships(
143145
rel.set_is_reference(true);
144146
saveSymbol(mixin, rel);
145147
}
148+
149+
fast_sort(rels, [](const auto &r1, const auto &r2) -> bool { return scip::compareRelationship(r1, r2) < 0; });
146150
}
147151

148152
string GenericSymbolRef::showRaw(const core::GlobalState &gs) const {

0 commit comments

Comments
 (0)