From 9b1a8d952161c0f6d159a6086797eb53d053134b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 12 Sep 2023 07:25:52 +0200 Subject: serialize: don't require patched StringView --- serialize/world-writer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'serialize/world-writer.cpp') 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 #include #include +#include #include #include #include @@ -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 -- cgit v1.2.3