diff --git a/src/jsonschema/walker.cc b/src/jsonschema/walker.cc index 1119bc19f..23856cfde 100644 --- a/src/jsonschema/walker.cc +++ b/src/jsonschema/walker.cc @@ -2,9 +2,10 @@ #include #include -#include // std::max, std::sort +#include // std::max #include // assert #include // std::accumulate +#include // std::ranges::sort auto sourcemeta::jsontoolkit::keyword_priority( std::string_view keyword, const std::map &vocabularies, @@ -207,8 +208,8 @@ sourcemeta::jsontoolkit::SchemaKeywordIterator::SchemaKeywordIterator( } // Sort keywords based on priority for correct evaluation - std::sort( - this->entries.begin(), this->entries.end(), + std::ranges::sort( + this->entries, [&vocabularies, &walker](const auto &left, const auto &right) -> bool { // These cannot be empty or indexes, as we created // the entries array from a JSON object