mirror of
https://github.com/nlohmann/json.git
synced 2026-09-28 18:50:31 +00:00
Check the JSON Pointer roundtrip for every code point again
Sampling every 64th element of all_unicode.json gave up the claim that every code point is tested for a small saving; the stringstream removal keeps most of the speedup. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -170,9 +170,6 @@ TEST_CASE("Unicode (1/5)" * doctest::skip())
|
||||
|
||||
SECTION("check JSON Pointers")
|
||||
{
|
||||
// escaping only treats '~' and '/' specially, so every 64th
|
||||
// element plus those two characters suffices (#5418)
|
||||
std::size_t index = 0;
|
||||
for (const auto& s : j)
|
||||
{
|
||||
// skip non-string JSON values
|
||||
@@ -183,11 +180,6 @@ TEST_CASE("Unicode (1/5)" * doctest::skip())
|
||||
|
||||
auto ptr = s.get<std::string>();
|
||||
|
||||
if (index++ % 64 != 0 && ptr != "~" && ptr != "/")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// tilde must be followed by 0 or 1
|
||||
if (ptr == "~")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user