diff options
| author | 2018-04-18 21:54:47 +0000 | |
|---|---|---|
| committer | 2018-04-18 21:54:47 +0000 | |
| commit | b2182c412c534be18a3b0c869d186fcf91a86a6d (patch) | |
| tree | ced776904ff0c4682642648dcfb04ca4902fb431 /tools/aapt2/StringPool.cpp | |
| parent | 2ee3ef0511eb2022597651dde68e3485148a42a4 (diff) | |
| parent | 4602926f83d7aa3b52b190122955b5b0d6d8089d (diff) | |
Merge "AAPT2: Modified StringPool uniqueness detection #2" into pi-dev
Diffstat (limited to 'tools/aapt2/StringPool.cpp')
| -rw-r--r-- | tools/aapt2/StringPool.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/aapt2/StringPool.cpp b/tools/aapt2/StringPool.cpp index b0ce9e1ec947..b37e1fbd9693 100644 --- a/tools/aapt2/StringPool.cpp +++ b/tools/aapt2/StringPool.cpp @@ -172,9 +172,11 @@ StringPool::Ref StringPool::MakeRef(const StringPiece& str, const Context& conte StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str, const Context& context, bool unique) { if (unique) { - auto iter = indexed_strings_.find(str); - if (iter != std::end(indexed_strings_)) { - return Ref(iter->second); + auto range = indexed_strings_.equal_range(str); + for (auto iter = range.first; iter != range.second; ++iter) { + if (context.priority == iter->second->context.priority) { + return Ref(iter->second); + } } } |