Skip to content

Commit 3baba73

Browse files
committed
Don't call functions in assume (VS2019 Clang doesn't like it)
1 parent db6bf15 commit 3baba73

File tree

5 files changed

+57
-44
lines changed

5 files changed

+57
-44
lines changed

include/simdjson/generic/ondemand/document-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ simdjson_really_inline document::document(ondemand::json_iterator &&_iter) noexc
99
}
1010

1111
simdjson_really_inline void document::assert_at_start() const noexcept {
12-
SIMDJSON_ASSUME(iter.at_start());
12+
iter.assert_at_start();
1313
}
1414
simdjson_really_inline document document::start(json_iterator &&iter) noexcept {
1515
return document(std::forward<json_iterator>(iter));

include/simdjson/generic/ondemand/json_iterator-inl.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,15 @@ simdjson_warn_unused simdjson_really_inline error_code json_iterator::skip_child
9191
}
9292

9393
simdjson_really_inline bool json_iterator::at_start() const noexcept {
94-
return token.index == parser->dom_parser.structural_indexes.get();
94+
return token.index == &parser->dom_parser.structural_indexes[0];
95+
}
96+
97+
simdjson_really_inline void json_iterator::assert_at_start() const noexcept {
98+
SIMDJSON_ASSUME( _depth == 1 );
99+
// Visual Studio Clang treats unique_ptr.get() as "side effecting."
100+
#ifndef SIMDJSON_CLANG_VISUAL_STUDIO
101+
SIMDJSON_ASSUME( token.index == parser->dom_parser.structural_indexes.get() );
102+
#endif
95103
}
96104

97105
simdjson_really_inline bool json_iterator::at_eof() const noexcept {
@@ -120,12 +128,12 @@ simdjson_really_inline uint32_t json_iterator::peek_length(int32_t delta) const
120128
}
121129

122130
simdjson_really_inline void json_iterator::ascend_to(depth_t parent_depth) noexcept {
123-
SIMDJSON_ASSUME(depth() == parent_depth + 1);
131+
SIMDJSON_ASSUME(_depth == parent_depth + 1);
124132
_depth = parent_depth;
125133
}
126134

127135
simdjson_really_inline void json_iterator::descend_to(depth_t child_depth) noexcept {
128-
SIMDJSON_ASSUME(depth() == child_depth - 1);
136+
SIMDJSON_ASSUME(_depth == child_depth - 1);
129137
_depth = child_depth;
130138
}
131139

include/simdjson/generic/ondemand/json_iterator.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ class json_iterator {
6262
*/
6363
simdjson_really_inline bool at_start() const noexcept;
6464

65+
/**
66+
* Assert if the iterator is not at the start
67+
*/
68+
simdjson_really_inline void assert_at_start() const noexcept;
69+
6570
/**
6671
* Tell whether the iterator is at the EOF mark
6772
*/

include/simdjson/generic/ondemand/object-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ simdjson_really_inline object::object(const value_iterator &_iter) noexcept
7878
}
7979

8080
simdjson_really_inline object_iterator object::begin() noexcept {
81-
SIMDJSON_ASSUME( iter.at_start || !iter.iter.is_open() );
81+
SIMDJSON_ASSUME( iter.at_start || iter.iter._json_iter->_depth < iter.iter._depth );
8282
return iter;
8383
}
8484
simdjson_really_inline object_iterator object::end() noexcept {

include/simdjson/generic/ondemand/value_iterator-inl.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ simdjson_really_inline value_iterator::value_iterator(json_iterator *json_iter,
99
}
1010

1111
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::start_object() noexcept {
12-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
12+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
1313

1414
if (*_json_iter->advance() != '{') { logger::log_error(*_json_iter, "Not an object"); return INCORRECT_TYPE; }
1515
return started_object();
1616
}
1717
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::try_start_object() noexcept {
18-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
18+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
1919

2020
if (*_json_iter->peek() != '{') { logger::log_error(*_json_iter, "Not an object"); return INCORRECT_TYPE; }
2121
_json_iter->advance();
2222
return started_object();
2323
}
2424

2525
simdjson_warn_unused simdjson_really_inline bool value_iterator::started_object() noexcept {
26-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
26+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
2727

2828
if (*_json_iter->peek() == '}') {
2929
logger::log_value(*_json_iter, "empty object");
@@ -37,7 +37,7 @@ simdjson_warn_unused simdjson_really_inline bool value_iterator::started_object(
3737
}
3838

3939
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::has_next_field() noexcept {
40-
SIMDJSON_ASSUME( _json_iter->depth() == depth() );
40+
SIMDJSON_ASSUME( _json_iter->_depth == _depth );
4141

4242
switch (*_json_iter->advance()) {
4343
case '}':
@@ -54,7 +54,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator
5454

5555
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::find_field_raw(const char *key) noexcept {
5656
// We assume we are sitting at a key: at "key": <value>
57-
SIMDJSON_ASSUME( _json_iter->depth() == depth()+1 );
57+
SIMDJSON_ASSUME( _json_iter->_depth == _depth+1 );
5858

5959
bool has_next;
6060
do {
@@ -81,37 +81,37 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator
8181
}
8282

8383
simdjson_warn_unused simdjson_really_inline simdjson_result<raw_json_string> value_iterator::field_key() noexcept {
84-
SIMDJSON_ASSUME( _json_iter->depth() == depth()+1 );
84+
SIMDJSON_ASSUME( _json_iter->_depth == _depth+1 );
8585

8686
const uint8_t *key = _json_iter->advance();
8787
if (*(key++) != '"') { return _json_iter->report_error(TAPE_ERROR, "Object key is not a string"); }
8888
return raw_json_string(key);
8989
}
9090

9191
simdjson_warn_unused simdjson_really_inline error_code value_iterator::field_value() noexcept {
92-
SIMDJSON_ASSUME( _json_iter->depth() == depth()+1 );
92+
SIMDJSON_ASSUME( _json_iter->_depth == _depth+1 );
9393

9494
if (*_json_iter->advance() != ':') { return _json_iter->report_error(TAPE_ERROR, "Missing colon in object field"); }
9595
return SUCCESS;
9696
}
9797

9898
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::start_array() noexcept {
99-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0);
99+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0);
100100

101101
if (*_json_iter->advance() != '[') { logger::log_error(*_json_iter, "Not an array"); return INCORRECT_TYPE; }
102102
return started_array();
103103
}
104104

105105
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::try_start_array() noexcept {
106-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0);
106+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0);
107107

108108
if (*_json_iter->peek() != '[') { logger::log_error(*_json_iter, "Not an array"); return INCORRECT_TYPE; }
109109
_json_iter->advance();
110110
return started_array();
111111
}
112112

113113
simdjson_warn_unused simdjson_really_inline bool value_iterator::started_array() noexcept {
114-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
114+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
115115

116116
if (*_json_iter->peek() == ']') {
117117
logger::log_value(*_json_iter, "empty array");
@@ -125,7 +125,7 @@ simdjson_warn_unused simdjson_really_inline bool value_iterator::started_array()
125125
}
126126

127127
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::has_next_element() noexcept {
128-
SIMDJSON_ASSUME( _json_iter->depth() == depth() );
128+
SIMDJSON_ASSUME( _json_iter->_depth == _depth );
129129

130130
switch (*_json_iter->advance()) {
131131
case ']':
@@ -147,7 +147,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<std::string_view> va
147147
return require_raw_json_string().unescape(_json_iter->string_buf_loc());
148148
}
149149
simdjson_warn_unused simdjson_really_inline simdjson_result<raw_json_string> value_iterator::try_get_raw_json_string() noexcept {
150-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
150+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
151151

152152
logger::log_value(*_json_iter, "string", "", 0);
153153
auto json = _json_iter->peek();
@@ -157,7 +157,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<raw_json_string> val
157157
return raw_json_string(json+1);
158158
}
159159
simdjson_warn_unused simdjson_really_inline simdjson_result<raw_json_string> value_iterator::require_raw_json_string() noexcept {
160-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 0 );
160+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 0 );
161161

162162
logger::log_value(*_json_iter, "string", "", 0);
163163
auto json = _json_iter->advance();
@@ -166,7 +166,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<raw_json_string> val
166166
return raw_json_string(json+1);
167167
}
168168
simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iterator::try_get_uint64() noexcept {
169-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
169+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
170170

171171
logger::log_value(*_json_iter, "uint64", "", 0);
172172
uint64_t result;
@@ -176,14 +176,14 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iter
176176
return result;
177177
}
178178
simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iterator::require_uint64() noexcept {
179-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
179+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
180180

181181
logger::log_value(*_json_iter, "uint64", "", 0);
182182
_json_iter->ascend_to(depth()-1);
183183
return numberparsing::parse_unsigned(_json_iter->advance());
184184
}
185185
simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_iterator::try_get_int64() noexcept {
186-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
186+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
187187

188188
logger::log_value(*_json_iter, "int64", "", 0);
189189
int64_t result;
@@ -193,14 +193,14 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_itera
193193
return result;
194194
}
195195
simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_iterator::require_int64() noexcept {
196-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
196+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
197197

198198
logger::log_value(*_json_iter, "int64", "", 0);
199199
_json_iter->ascend_to(depth()-1);
200200
return numberparsing::parse_integer(_json_iter->advance());
201201
}
202202
simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterator::try_get_double() noexcept {
203-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
203+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
204204

205205
logger::log_value(*_json_iter, "double", "", 0);
206206
double result;
@@ -210,7 +210,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterat
210210
return result;
211211
}
212212
simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterator::require_double() noexcept {
213-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
213+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
214214

215215
logger::log_value(*_json_iter, "double", "", 0);
216216
_json_iter->ascend_to(depth()-1);
@@ -225,7 +225,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator
225225
return simdjson_result<bool>(!not_true);
226226
}
227227
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::try_get_bool() noexcept {
228-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
228+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
229229

230230
bool result;
231231
SIMDJSON_TRY( parse_bool(_json_iter->peek()).get(result) );
@@ -234,7 +234,7 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator
234234
return result;
235235
}
236236
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::require_bool() noexcept {
237-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
237+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
238238

239239
_json_iter->ascend_to(depth()-1);
240240
return parse_bool(_json_iter->advance());
@@ -247,7 +247,7 @@ simdjson_really_inline bool value_iterator::is_null(const uint8_t *json) const n
247247
return false;
248248
}
249249
simdjson_really_inline bool value_iterator::is_null() noexcept {
250-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
250+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
251251

252252
if (is_null(_json_iter->peek())) {
253253
_json_iter->advance();
@@ -257,7 +257,7 @@ simdjson_really_inline bool value_iterator::is_null() noexcept {
257257
return false;
258258
}
259259
simdjson_really_inline bool value_iterator::require_null() noexcept {
260-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() > 1 );
260+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth > 1 );
261261

262262
_json_iter->ascend_to(depth()-1);
263263
return is_null(_json_iter->advance());
@@ -266,7 +266,7 @@ simdjson_really_inline bool value_iterator::require_null() noexcept {
266266
constexpr const uint32_t MAX_INT_LENGTH = 1024;
267267

268268
simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iterator::parse_root_uint64(const uint8_t *json, uint32_t max_len) const noexcept {
269-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
269+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
270270

271271
uint8_t tmpbuf[20+1]; // <20 digits> is the longest possible unsigned integer
272272
if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf)) { logger::log_error(*_json_iter, "Root number more than 20 characters"); return NUMBER_ERROR; }
@@ -276,21 +276,21 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iter
276276
return result;
277277
}
278278
simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iterator::try_get_root_uint64() noexcept {
279-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
279+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
280280

281281
uint64_t result;
282282
SIMDJSON_TRY( parse_root_uint64(_json_iter->peek(), _json_iter->peek_length()).get(result) );
283283
_json_iter->advance();
284284
return result;
285285
}
286286
simdjson_warn_unused simdjson_really_inline simdjson_result<uint64_t> value_iterator::require_root_uint64() noexcept {
287-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
287+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
288288

289289
auto max_len = _json_iter->peek_length();
290290
return parse_root_uint64(_json_iter->advance(), max_len);
291291
}
292292
simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_iterator::parse_root_int64(const uint8_t *json, uint32_t max_len) const noexcept {
293-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
293+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
294294

295295
uint8_t tmpbuf[20+1]; // -<19 digits> is the longest possible integer
296296
if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf)) { logger::log_error(*_json_iter, "Root number more than 20 characters"); return NUMBER_ERROR; }
@@ -300,21 +300,21 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_itera
300300
return result;
301301
}
302302
simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_iterator::try_get_root_int64() noexcept {
303-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
303+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
304304

305305
int64_t result;
306306
SIMDJSON_TRY( parse_root_int64(_json_iter->peek(), _json_iter->peek_length()).get(result) );
307307
_json_iter->advance();
308308
return result;
309309
}
310310
simdjson_warn_unused simdjson_really_inline simdjson_result<int64_t> value_iterator::require_root_int64() noexcept {
311-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
311+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
312312

313313
auto max_len = _json_iter->peek_length();
314314
return parse_root_int64(_json_iter->advance(), max_len);
315315
}
316316
simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterator::parse_root_double(const uint8_t *json, uint32_t max_len) const noexcept {
317-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
317+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
318318

319319
// Per https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/, 1074 is the maximum number of significant fractional digits. Add 8 more digits for the biggest number: -0.<fraction>e-308.
320320
uint8_t tmpbuf[1074+8+1];
@@ -325,56 +325,56 @@ simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterat
325325
return result;
326326
}
327327
simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterator::try_get_root_double() noexcept {
328-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
328+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
329329

330330
double result;
331331
SIMDJSON_TRY( parse_root_double(_json_iter->peek(), _json_iter->peek_length()).get(result) );
332332
_json_iter->advance();
333333
return result;
334334
}
335335
simdjson_warn_unused simdjson_really_inline simdjson_result<double> value_iterator::require_root_double() noexcept {
336-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
336+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
337337

338338
auto max_len = _json_iter->peek_length();
339339
return parse_root_double(_json_iter->advance(), max_len);
340340
}
341341
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::parse_root_bool(const uint8_t *json, uint32_t max_len) const noexcept {
342-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
342+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
343343

344344
uint8_t tmpbuf[5+1];
345345
if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf)) { logger::log_error(*_json_iter, "Not a boolean"); return INCORRECT_TYPE; }
346346
return parse_bool(tmpbuf);
347347
}
348348
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::try_get_root_bool() noexcept {
349-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
349+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
350350

351351
bool result;
352352
SIMDJSON_TRY( parse_root_bool(_json_iter->peek(), _json_iter->peek_length()).get(result) );
353353
_json_iter->advance();
354354
return result;
355355
}
356356
simdjson_warn_unused simdjson_really_inline simdjson_result<bool> value_iterator::require_root_bool() noexcept {
357-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
357+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
358358

359359
auto max_len = _json_iter->peek_length();
360360
return parse_root_bool(_json_iter->advance(), max_len);
361361
}
362362
simdjson_really_inline bool value_iterator::is_root_null(const uint8_t *json, uint32_t max_len) const noexcept {
363-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
363+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
364364

365365
uint8_t tmpbuf[4+1];
366366
if (!_json_iter->copy_to_buffer(json, max_len, tmpbuf)) { return false; }
367367
return is_null(tmpbuf);
368368
}
369369
simdjson_really_inline bool value_iterator::is_root_null() noexcept {
370-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
370+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
371371

372372
if (!is_root_null(_json_iter->peek(), _json_iter->peek_length())) { return false; }
373373
_json_iter->advance();
374374
return true;
375375
}
376376
simdjson_really_inline bool value_iterator::require_root_null() noexcept {
377-
SIMDJSON_ASSUME( _json_iter->depth() == depth() && depth() == 1 );
377+
SIMDJSON_ASSUME( _json_iter->_depth == _depth && _depth == 1 );
378378

379379
auto max_len = _json_iter->peek_length();
380380
return is_root_null(_json_iter->advance(), max_len);
@@ -384,7 +384,7 @@ simdjson_warn_unused simdjson_really_inline error_code value_iterator::skip_chil
384384
return _json_iter->skip_child(depth());
385385
}
386386
simdjson_really_inline value_iterator value_iterator::child() const noexcept {
387-
SIMDJSON_ASSUME( _json_iter->depth() == depth()+1 );
387+
SIMDJSON_ASSUME( _json_iter->_depth == _depth+1 );
388388
return { _json_iter, depth()+1 };
389389
}
390390

0 commit comments

Comments
 (0)