diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-12 07:25:52 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-12 08:03:57 +0200 |
commit | 9b1a8d952161c0f6d159a6086797eb53d053134b (patch) | |
tree | a0e17fd9c489c0a99a8a1996046a7717b595b63a /serialize | |
parent | fd6ea6bf5a1c9b90e730944cea1c9ebdf1760f12 (diff) |
serialize: don't require patched StringView
Diffstat (limited to 'serialize')
-rw-r--r-- | serialize/world-writer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp index fedf96d6..0c15291a 100644 --- a/serialize/world-writer.cpp +++ b/serialize/world-writer.cpp @@ -17,6 +17,7 @@ #include <cstring> #include <vector> #include <algorithm> +#include <string_view> #include <tsl/robin_map.h> #include <Corrade/Containers/StringStlHash.h> #include <Corrade/Utility/Path.h> @@ -253,7 +254,9 @@ void writer_state::serialize_scenery_names() fm_assert(sz == vec.size()); std::sort(vec.begin(), vec.end(), [](const interned_scenery& a, const interned_scenery& b) { - auto cmp = a.s->name <=> b.s->name; + auto a_ = std::string_view{a.s->name.data(), a.s->name.size()}, + b_ = std::string_view{b.s->name.data(), b.s->name.size()}; + auto cmp = a_ <=> b_; if (cmp == std::strong_ordering::equal) return a.index < b.index; else |