Skip to content

Commit 2ca8dab

Browse files
authored
Remove a magic number (#3888)
1 parent 885aa00 commit 2ca8dab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/nlohmann/detail/output/serializer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ class serializer
927927
: (0xFFu >> type) & (byte);
928928

929929
const std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
930-
JSON_ASSERT(index < 400);
930+
JSON_ASSERT(index < utf8d.size());
931931
state = utf8d[index];
932932
return state;
933933
}

single_include/nlohmann/json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18849,7 +18849,7 @@ class serializer
1884918849
: (0xFFu >> type) & (byte);
1885018850

1885118851
const std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
18852-
JSON_ASSERT(index < 400);
18852+
JSON_ASSERT(index < utf8d.size());
1885318853
state = utf8d[index];
1885418854
return state;
1885518855
}

0 commit comments

Comments
 (0)