File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ struct JsonParser::Private {
3737 const bool silent;
3838 bool jsonValid;
3939 bool hasError;
40- pt::ptree defList;
40+ pt::ptree root;
41+ pt::ptree *defList;
4142 pt::ptree::const_iterator defIter;
4243 int defNumber;
4344 TScanProps scanProps;
@@ -91,17 +92,17 @@ JsonParser::JsonParser(
9192{
9293 try {
9394 // parse JSON
94- pt::ptree root;
95- read_json (input, root);
95+ read_json (input, d->root );
9696
9797 // get the defect list
98- d->defList = root.get_child (" defects" );
99- d->defIter = d->defList . begin ();
98+ d->defList = &d-> root .get_child (" defects" );
99+ d->defIter = d->defList -> begin ();
100100 d->jsonValid = true ;
101101
102102 // read scan properties if available
103103 pt::ptree emp;
104- pt::ptree scanNode = root.get_child_optional (" scan" ).get_value_or (emp);
104+ pt::ptree scanNode =
105+ d->root .get_child_optional (" scan" ).get_value_or (emp);
105106 BOOST_FOREACH (const pt::ptree::value_type &item, scanNode)
106107 d->scanProps [item.first ] = item.second .data ();
107108 }
@@ -214,7 +215,7 @@ bool JsonParser::getNext(Defect *def) {
214215
215216 // error recovery loop
216217 for (;;) {
217- if (d->defList . end () == d->defIter )
218+ if (d->defList -> end () == d->defIter )
218219 return false ;
219220
220221 if (d->readNext (def))
You can’t perform that action at this time.
0 commit comments