This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
[core] Convert uses of std::set to std::unordered_set - #6325
Merged
Merged
Conversation
|
@lucaswoj, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @tmpsantos and @ansis to be potential reviewers. |
lucaswoj
force-pushed
the
unorderedquest
branch
2 times, most recently
from
September 13, 2016 23:18
6f71e9f to
3f0a375
Compare
lucaswoj
force-pushed
the
unorderedquest
branch
from
September 15, 2016 22:04
b6515d2 to
72457fe
Compare
Contributor
Author
|
Ready for 👀 @jfirebaugh @tmpsantos @bleege |
jfirebaugh
approved these changes
Sep 15, 2016
added 12 commits
September 19, 2016 16:39
jfirebaugh
force-pushed
the
unorderedquest
branch
from
September 19, 2016 23:45
db0fc15 to
7c544a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
std::setcollection is ordered. It is less efficient than itsstd::unordered_setcounterpart. This PR converts as many uses ofstd::setintostd::unordered_setas possible.see #3980
Todo
std::setin the "Needs More work 🚧 " sectionGlyphRangeSettypedefUses of
std::setBelow is a list of all uses of
std::set. We will check of each as it is switched tostd::unordered_setor we confirm that it cannot be switched.Changed ✅
./include/mbgl/storage/network_status.hpp:31: static std::set<util::AsyncTask*> observers;done in ac000d10a301d7e2a7c4dc66d84222e7d319d244./src/mbgl/algorithm/generate_clip_ids.hpp:20: std::set<CanonicalTileID> children;done in a289d58e346cfb2ef4ffcfe160734d59222fb013./src/mbgl/algorithm/update_renderables.hpp:24: std::set<UnwrappedTileID> checked;done in de20cd0a8da4edfc899020f24de288339ca4e947./src/mbgl/annotation/annotation_manager.hpp:76: std::set<std::string> obsoleteShapeAnnotationLayers;done in f1f73f42349./src/mbgl/annotation/annotation_manager.hpp:77: std::set<AnnotationTile*> tiles;f1f73f42349./src/mbgl/geometry/glyph_atlas.hpp:49: std::set<uintptr_t> ids;done in abce9d0./src/mbgl/renderer/painter.cpp:83: const std::set<Source*>& sources = renderData.sources;done in 0d9b495e8042c27816d52034a9709dba33fbd564./src/mbgl/renderer/render_item.hpp:34: std::set<style::Source*> sources;done in 0d9b495e8042c27816d52034a9709dba33fbd564./src/mbgl/renderer/symbol_bucket.hpp:130: std::set<GlyphRange> ranges;done in 55bafc5ca55e7c1364e79955a9e8fc60552b6a56./src/mbgl/sprite/sprite_atlas.hpp:92: std::set<std::string> uninitialized;done in 2b40808a818ef46a0b7bf06863fa424c4ca0e9de./src/mbgl/storage/network_status.cpp:14:std::set<util::AsyncTask *> NetworkStatus::observers;done in ac000d10a301d7e2a7c4dc66d84222e7d319d244./src/mbgl/text/collision_tile.cpp:159: std::unordered_map<std::string, std::set<std::size_t>> sourceLayerFeatures;done in 11e109599d947420e2fa8e1a9249bd29341773ff./src/mbgl/text/glyph_store.cpp:31:bool GlyphStore::hasGlyphRanges(const FontStack& fontStack, const std::set<GlyphRange>& glyphRanges) {done in 55bafc5ca55e7c1364e79955a9e8fc60552b6a56./src/mbgl/text/glyph_store.hpp:37: bool hasGlyphRanges(const FontStack&, const std::set<GlyphRange>&);done in 55bafc5./src/mbgl/tile/tile_worker.cpp:58: std::set<std::string> parsed;done in ecbb4b26e11a204de46be1cf638dc6ba505fad4c./src/mbgl/style/update_batch.hpp:11: std::set<std::string> sourceIDs;done in 3f0a3752410cca620ee92528e2690b6086ddcb9a./platform/default/mbgl/storage/offline_download.hppdone in 0ca2c61./src/mbgl/style/source_impl.cpp:108: std::set<OverscaledTileID> retain;done in 3a65ea3Won't Change 🙅
see Revisit std::map and std::set usage #3980 (comment)./src/clipper/clipper.cpp:4707: std::set<int> & visited,see Revisit std::map and std::set usage #3980 (comment)./src/clipper/clipper.cpp:4830: std::set<int> visited;see Revisit std::map and std::set usage #3980 (comment)./src/clipper/clipper.hpp:387: std::set<int> & visited,Revisit std::map and std::set usage #3980 (comment)./src/mbgl/util/url.cpp:23: encoded << '%' << std::setw(2) << int(c);this is a legitimate use of an ordered set./src/mbgl/style/parser.cpp:237: std::set<FontStack> result;