mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Move increment_count to stage 2
This commit is contained in:
@@ -1042,7 +1042,6 @@ public:
|
||||
really_inline bool on_number_u64(uint64_t value) noexcept; ///< @private
|
||||
really_inline bool on_number_double(double value) noexcept; ///< @private
|
||||
|
||||
really_inline void increment_count(scope_descriptor &scope) noexcept; ///< @private
|
||||
really_inline void end_scope(uint32_t depth) noexcept; ///< @private
|
||||
private:
|
||||
/**
|
||||
|
||||
@@ -26,13 +26,6 @@ really_inline error_code parser::on_success(error_code success_code) noexcept {
|
||||
valid = true;
|
||||
return success_code;
|
||||
}
|
||||
// increment_count increments the count of keys in an object or values in an array.
|
||||
// Note that if you are at the level of the values or elements, the count
|
||||
// must be increment in the preceding depth (depth-1) where the array or
|
||||
// the object resides.
|
||||
really_inline void parser::increment_count(scope_descriptor &scope) noexcept {
|
||||
scope.count++;
|
||||
}
|
||||
|
||||
really_inline bool parser::on_start_document(uint32_t depth) noexcept {
|
||||
containing_scope[depth].tape_index = current_loc;
|
||||
|
||||
@@ -162,8 +162,12 @@ struct structural_parser {
|
||||
return false;
|
||||
}
|
||||
|
||||
// increment_count increments the count of keys in an object or values in an array.
|
||||
// Note that if you are at the level of the values or elements, the count
|
||||
// must be increment in the preceding depth (depth-1) where the array or
|
||||
// the object resides.
|
||||
really_inline void increment_count() {
|
||||
doc_parser.increment_count(doc_parser.containing_scope[depth - 1]); // we have a key value pair in the object at parser.depth - 1
|
||||
doc_parser.containing_scope[depth - 1].count++; // we have a key value pair in the object at parser.depth - 1
|
||||
}
|
||||
|
||||
WARN_UNUSED really_inline bool parse_string() {
|
||||
|
||||
Reference in New Issue
Block a user