Skip to content

Commit

Permalink
More efficient numerical keys (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry authored Jan 4, 2025
1 parent 3570e43 commit 4e39cae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/glaze/json/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,9 @@ namespace glz
if constexpr (str_t<Key> || char_t<Key> || glaze_enum_t<Key> || Opts.quoted_num) {
to<JSON, core_t<Key>>::template op<Opts>(key, ctx, b, ix);
}
else if constexpr (num_t<Key>) {
write<JSON>::op<opt_true<Opts, &opts::quoted_num>>(key, ctx, b, ix);
}
else {
write<JSON>::op<opt_false<Opts, &opts::raw_string>>(quoted_t<const Key>{key}, ctx, b, ix);
}
Expand Down

0 comments on commit 4e39cae

Please sign in to comment.