Test more strides
This commit is contained in:
@@ -192,7 +192,7 @@ inline std::string toString(JsonValue const &jsonValue) {
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
inline std::optional<JsonValue> toValue(std::string copy, int stride = 0) {
|
||||
inline std::optional<JsonValue> toValue(std::string copy, int stride) {
|
||||
ReadValueState state;
|
||||
auto c = readValueCallbacks();
|
||||
parser3::Parser3 parser(&c, &state);
|
||||
@@ -202,7 +202,8 @@ inline std::optional<JsonValue> toValue(std::string copy, int stride = 0) {
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < copy.size(); i += stride) {
|
||||
if (parser.parse(copy.data(), std::min<int>(stride, copy.size() - i)) !=
|
||||
if (parser.parse(copy.data() + i,
|
||||
std::min<int>(stride, copy.size() - i)) !=
|
||||
parser3::S_AGAIN) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user