File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -26,17 +26,14 @@ class Sax {
26
26
std::vector<my_point> container{};
27
27
};
28
28
29
- using namespace simdjson ;
30
- using namespace simdjson ::builtin;
31
- using namespace simdjson ::builtin::stage2;
32
29
struct sax_point_reader_visitor {
33
30
public:
34
31
std::vector<my_point> &points;
35
32
enum {GOT_X=0 , GOT_Y=1 , GOT_Z=2 , GOT_SOMETHING_ELSE=4 };
36
33
size_t idx{GOT_SOMETHING_ELSE};
37
- double buffer[3 ];
34
+ double buffer[3 ]={} ;
38
35
39
- sax_point_reader_visitor (std::vector<my_point> &_points) : points(_points) {}
36
+ explicit sax_point_reader_visitor (std::vector<my_point> &_points) : points(_points) {}
40
37
41
38
simdjson_really_inline error_code visit_object_start (json_iterator &) {
42
39
idx = 0 ;
@@ -96,7 +93,7 @@ error_code Sax::RunNoExcept(const padded_string &json) noexcept {
96
93
}
97
94
98
95
// Run stage 1 first.
99
- SIMDJSON_TRY ( dom_parser.stage1 (( uint8_t *) json.data (), json.size (), false ) );
96
+ SIMDJSON_TRY ( dom_parser.stage1 (json.u8data (), json.size (), false ) );
100
97
101
98
// Then walk the document, parsing the tweets as we go
102
99
json_iterator iter (dom_parser, 0 );
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ struct padded_string final {
85
85
* The string data.
86
86
**/
87
87
const char *data () const noexcept ;
88
+ const uint8_t *u8data () const noexcept { return static_cast <const uint8_t *>(static_cast <const void *>(data_ptr));}
88
89
89
90
/* *
90
91
* The string data.
You can’t perform that action at this time.
0 commit comments