Skip to content

Commit 4f25b6a

Browse files
committed
Move on_end_* to stage 2 code
1 parent 3d5ed1a commit 4f25b6a

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

include/simdjson/document.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,6 @@ class parser {
10271027
really_inline error_code on_error(error_code new_error_code) noexcept; ///< @private
10281028
really_inline error_code on_success(error_code success_code) noexcept; ///< @private
10291029
// TODO we're not checking this bool
1030-
really_inline bool on_end_document(uint32_t start_tape_index) noexcept; ///< @private
1031-
really_inline bool on_end_object(uint32_t start_tape_index) noexcept; ///< @private
1032-
really_inline bool on_end_array(uint32_t start_tape_index) noexcept; ///< @private
10331030
really_inline bool on_true_atom() noexcept; ///< @private
10341031
really_inline bool on_false_atom() noexcept; ///< @private
10351032
really_inline bool on_null_atom() noexcept; ///< @private

src/document_parser_callbacks.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,6 @@ really_inline error_code parser::on_success(error_code success_code) noexcept {
2727
return success_code;
2828
}
2929

30-
// TODO we're not checking this bool
31-
really_inline bool parser::on_end_document(uint32_t start_tape_index) noexcept {
32-
// write our doc.tape location to the header scope
33-
// The root scope gets written *at* the previous location.
34-
write_tape(start_tape_index, internal::tape_type::ROOT);
35-
return true;
36-
}
37-
really_inline bool parser::on_end_object(uint32_t start_tape_index) noexcept {
38-
// write our doc.tape location to the header scope
39-
write_tape(start_tape_index, internal::tape_type::END_OBJECT);
40-
return true;
41-
}
42-
really_inline bool parser::on_end_array(uint32_t start_tape_index) noexcept {
43-
// write our doc.tape location to the header scope
44-
write_tape(start_tape_index, internal::tape_type::END_ARRAY);
45-
return true;
46-
}
4730

4831
really_inline bool parser::on_true_atom() noexcept {
4932
write_tape(0, internal::tape_type::TRUE_VALUE);

src/generic/stage2_build_tape.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,23 @@ struct structural_parser {
165165

166166
really_inline bool end_object() {
167167
depth--;
168-
doc_parser.on_end_object(doc_parser.containing_scope[depth].tape_index);
168+
// write our doc.tape location to the header scope
169+
doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::END_OBJECT);
169170
end_scope();
170171
return false;
171172
}
172173
really_inline bool end_array() {
173174
depth--;
174-
doc_parser.on_end_array(doc_parser.containing_scope[depth].tape_index);
175+
// write our doc.tape location to the header scope
176+
doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::END_ARRAY);
175177
end_scope();
176178
return false;
177179
}
178180
really_inline bool end_document() {
179181
depth--;
180-
doc_parser.on_end_document(doc_parser.containing_scope[depth].tape_index);
182+
// write our doc.tape location to the header scope
183+
// The root scope gets written *at* the previous location.
184+
doc_parser.write_tape(doc_parser.containing_scope[depth].tape_index, internal::tape_type::ROOT);
181185
end_scope();
182186
return false;
183187
}

0 commit comments

Comments
 (0)