diff --git a/include/simdjson/document.h b/include/simdjson/document.h index 001aaaac..fd9cdb58 100644 --- a/include/simdjson/document.h +++ b/include/simdjson/document.h @@ -1027,9 +1027,6 @@ public: really_inline error_code on_error(error_code new_error_code) noexcept; ///< @private really_inline error_code on_success(error_code success_code) noexcept; ///< @private // TODO we're not checking this bool - really_inline bool on_end_document(uint32_t start_tape_index) noexcept; ///< @private - really_inline bool on_end_object(uint32_t start_tape_index) noexcept; ///< @private - really_inline bool on_end_array(uint32_t start_tape_index) noexcept; ///< @private really_inline bool on_true_atom() noexcept; ///< @private really_inline bool on_false_atom() noexcept; ///< @private really_inline bool on_null_atom() noexcept; ///< @private diff --git a/src/document_parser_callbacks.h b/src/document_parser_callbacks.h index b09e4b39..14e87027 100644 --- a/src/document_parser_callbacks.h +++ b/src/document_parser_callbacks.h @@ -27,23 +27,6 @@ really_inline error_code parser::on_success(error_code success_code) noexcept { return success_code; } -// TODO we're not checking this bool -really_inline bool parser::on_end_document(uint32_t start_tape_index) noexcept { - // write our doc.tape location to the header scope - // The root scope gets written *at* the previous location. - write_tape(start_tape_index, internal::tape_type::ROOT); - return true; -} -really_inline bool parser::on_end_object(uint32_t start_tape_index) noexcept { - // write our doc.tape location to the header scope - write_tape(start_tape_index, internal::tape_type::END_OBJECT); - return true; -} -really_inline bool parser::on_end_array(uint32_t start_tape_index) noexcept { - // write our doc.tape location to the header scope - write_tape(start_tape_index, internal::tape_type::END_ARRAY); - return true; -} really_inline bool parser::on_true_atom() noexcept { write_tape(0, internal::tape_type::TRUE_VALUE); diff --git a/src/generic/stage2_build_tape.h b/src/generic/stage2_build_tape.h index cfd81d72..219fb70e 100644 --- a/src/generic/stage2_build_tape.h +++ b/src/generic/stage2_build_tape.h @@ -165,19 +165,23 @@ struct structural_parser { really_inline bool end_object() { depth--; - doc_parser.on_end_object(doc_parser.containing_scope[depth].tape_index); + // write our doc.tape location to the header scope + doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::END_OBJECT); end_scope(); return false; } really_inline bool end_array() { depth--; - doc_parser.on_end_array(doc_parser.containing_scope[depth].tape_index); + // write our doc.tape location to the header scope + doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::END_ARRAY); end_scope(); return false; } really_inline bool end_document() { depth--; - doc_parser.on_end_document(doc_parser.containing_scope[depth].tape_index); + // write our doc.tape location to the header scope + // The root scope gets written *at* the previous location. + doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::ROOT); end_scope(); return false; }