From 4d99d22e10a3cb2a421da1618c127128816613c9 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 26 Sep 2023 13:36:07 +1000 Subject: std::string -> std::pmr::string in psram --- src/database/index.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/database/index.cpp') diff --git a/src/database/index.cpp b/src/database/index.cpp index 9d77e530..79939aaa 100644 --- a/src/database/index.cpp +++ b/src/database/index.cpp @@ -41,7 +41,7 @@ const IndexInfo kAllAlbums{ }; static auto missing_component_text(const Track& track, Tag tag) - -> std::optional { + -> std::optional { switch (tag) { case Tag::kArtist: return "Unknown Artist"; @@ -76,9 +76,9 @@ auto Index(const IndexInfo& info, const Track& t, leveldb::WriteBatch* batch) for (std::uint8_t i = 0; i < info.components.size(); i++) { // Fill in the text for this depth. auto text = t.tags().at(info.components.at(i)); - std::string value; + std::pmr::string value; if (text) { - std::string orig = *text; + std::pmr::string orig = *text; key.item = col.transform(&orig[0], &orig[0] + orig.size()); value = *text; } else { @@ -94,7 +94,7 @@ auto Index(const IndexInfo& info, const Track& t, leveldb::WriteBatch* batch) } auto encoded = EncodeIndexKey(key); - batch->Put(encoded.slice, value); + batch->Put(encoded.slice, {value.data(), value.size()}); // If there are more components after this, then we need to finish by // narrowing the header with the current title. @@ -106,7 +106,7 @@ auto Index(const IndexInfo& info, const Track& t, leveldb::WriteBatch* batch) } auto ExpandHeader(const IndexKey::Header& header, - const std::optional& component) + const std::optional& component) -> IndexKey::Header { IndexKey::Header ret{header}; ret.depth++; -- cgit v1.2.3