diff options
| author | Glenn Smith <glenn@vector35.com> | 2025-02-12 17:06:31 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2025-02-13 13:51:54 -0500 |
| commit | 5365728462076834832090072788972585260876 (patch) | |
| tree | 488624f36cc3c3da2bb2acb14cf76a9e39918619 /view/sharedcache/core/SharedCache.cpp | |
| parent | 1925885513166893508719453618249182735388 (diff) | |
[SharedCache] Use StringRef for performance
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
| -rw-r--r-- | view/sharedcache/core/SharedCache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index 79cff43e..834ac988 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -3154,7 +3154,7 @@ extern "C" for (size_t i = 0; i < value.size(); i++) { symbols[i].address = value[i].second->GetAddress(); - symbols[i].name = BNAllocString(value[i].second->GetRawName().c_str()); + symbols[i].name = BNDuplicateStringRef(value[i].second->GetRawNameRef().GetObject()); symbols[i].image = BNAllocString(value[i].first.c_str()); } return symbols; @@ -3167,7 +3167,7 @@ extern "C" { for (size_t i = 0; i < count; i++) { - BNFreeString(symbols[i].name); + BNFreeStringRef(symbols[i].name); BNFreeString(symbols[i].image); } delete symbols; @@ -3468,7 +3468,7 @@ void SharedCache::Store(SerializationContext& context) const context.writer.StartObject(); Serialize(context, "key", pair2.first); Serialize(context, "val1", pair2.second->GetType()); - Serialize(context, "val2", pair2.second->GetRawName()); + Serialize(context, "val2", (std::string_view)pair2.second->GetRawNameRef()); context.writer.EndObject(); } context.writer.EndArray(); |
