I want my sorts to be stable, please

This commit is contained in:
Erica Fischer
2024-02-28 16:05:51 -08:00
parent c49cebb541
commit 329279960f
10 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -604,7 +604,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
locs.push_back(encode_index(SHIFT_LEFT(scaled_geometry[i].x), SHIFT_LEFT(scaled_geometry[i].y)));
}
}
std::sort(locs.begin(), locs.end());
std::stable_sort(locs.begin(), locs.end());
size_t n = 0;
double sum = 0;
for (size_t i = 1; i < locs.size(); i++) {