diff options
| author | 2022-11-30 16:22:19 +0000 | |
|---|---|---|
| committer | 2022-11-30 16:22:19 +0000 | |
| commit | 33f36e06a87330f3194c2eadae4cc9e033027e61 (patch) | |
| tree | 57a408d2f6a35dcf7da5d1460eec415929462c5b /libs/androidfw/StringPool.cpp | |
| parent | 894ef374e538163d32ea29c370465c448edb7ced (diff) | |
| parent | a577514789fc241abe15f793a66f19d6431f7769 (diff) | |
Merge "Make StringPiece to be std::string_view alias"
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
| -rw-r--r-- | libs/androidfw/StringPool.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/androidfw/StringPool.cpp b/libs/androidfw/StringPool.cpp index b59e906f6281..1cb8df311c89 100644 --- a/libs/androidfw/StringPool.cpp +++ b/libs/androidfw/StringPool.cpp @@ -161,16 +161,15 @@ const StringPool::Context& StringPool::StyleRef::GetContext() const { return entry_->context; } -StringPool::Ref StringPool::MakeRef(const StringPiece& str) { +StringPool::Ref StringPool::MakeRef(StringPiece str) { return MakeRefImpl(str, Context{}, true); } -StringPool::Ref StringPool::MakeRef(const StringPiece& str, const Context& context) { +StringPool::Ref StringPool::MakeRef(StringPiece str, const Context& context) { return MakeRefImpl(str, context, true); } -StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str, const Context& context, - bool unique) { +StringPool::Ref StringPool::MakeRefImpl(StringPiece str, const Context& context, bool unique) { if (unique) { auto range = indexed_strings_.equal_range(str); for (auto iter = range.first; iter != range.second; ++iter) { @@ -181,7 +180,7 @@ StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str, const Context& c } std::unique_ptr<Entry> entry(new Entry()); - entry->value = str.to_string(); + entry->value = std::string(str); entry->context = context; entry->index_ = strings_.size(); entry->ref_ = 0; |