yakra / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
0 stars 0 forks source link

sorting unordered_maps #205

Closed yakra closed 2 years ago

yakra commented 2 years ago

Don't: Iterate thru a sorted list of keys, looking up each value in turn

DO: create a list of std::pair s from the map, sort by key value, and iterate thru that.

yakra commented 2 years ago

The only instances I can think of of this happening are with regions in stats CSV files and user logs. Replacing both Region::allregions and Region::code_hash with a std::map should take care of this. If there are more cases, they'll be found when investigating all occurrences of unordered_maps, as enumerated in #227. Closing this for housekeeping purposes.