diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-09-26 13:36:07 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-09-26 13:36:07 +1000 |
| commit | 4d99d22e10a3cb2a421da1618c127128816613c9 (patch) | |
| tree | 527490a466348e5cf40cf10a8f3768aa5be4e7c1 /src/database/index.cpp | |
| parent | f6d06421090f88094aba76b72b04d614f54efafa (diff) | |
| download | tangara-fw-4d99d22e10a3cb2a421da1618c127128816613c9.tar.gz | |
std::string -> std::pmr::string in psram
Diffstat (limited to 'src/database/index.cpp')
| -rw-r--r-- | src/database/index.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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::string> { + -> std::optional<std::pmr::string> { 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<std::string>& component) + const std::optional<std::pmr::string>& component) -> IndexKey::Header { IndexKey::Header ret{header}; ret.depth++; |
