summaryrefslogtreecommitdiff
path: root/tools/aapt2/StringPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/StringPool.cpp')
-rw-r--r--tools/aapt2/StringPool.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/aapt2/StringPool.cpp b/tools/aapt2/StringPool.cpp
index b0ce9e1ec947..73a8259a3a87 100644
--- a/tools/aapt2/StringPool.cpp
+++ b/tools/aapt2/StringPool.cpp
@@ -172,9 +172,10 @@ 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);
+ for (auto& indexed_str : indexed_strings_) {
+ if (str == indexed_str.first && context.priority == indexed_str.second->context.priority) {
+ return Ref(indexed_str.second);
+ }
}
}