Skip to content

Commit

Permalink
Fixed strict weak ordering in cache keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfellows committed Dec 16, 2024
1 parent 8173cc7 commit 59a4826
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ struct GCCacheKey {
}

bool operator<(const GCCacheKey& other) const {
if (_classifierValues.size() < other._classifierValues.size()) {
return true;
if (_classifierValues.size() != other._classifierValues.size()) {
return _classifierValues.size() < other._classifierValues.size();
}

for (int i = 0; i < _classifierValues.size(); i++) {
if (_classifierValues[i] < other._classifierValues[i]) {
return true;
if (_classifierValues[i] != other._classifierValues[i]) {
return _classifierValues[i] < other._classifierValues[i];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ struct TRCacheKey {
}

bool operator<(const TRCacheKey& other) const {
if (_classifierValues.size() < other._classifierValues.size()) {
return true;
if (_classifierValues.size() != other._classifierValues.size()) {
return _classifierValues.size() < other._classifierValues.size();
}

for (int i = 0; i < _classifierValues.size(); i++) {
if (_classifierValues[i] < other._classifierValues[i]) {
return true;
if (_classifierValues[i] != other._classifierValues[i]) {
return _classifierValues[i] < other._classifierValues[i];
}
}

Expand Down

0 comments on commit 59a4826

Please sign in to comment.