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 {
37
37
const bool silent;
38
38
bool jsonValid;
39
39
bool hasError;
40
- pt::ptree defList;
40
+ pt::ptree root;
41
+ pt::ptree *defList;
41
42
pt::ptree::const_iterator defIter;
42
43
int defNumber;
43
44
TScanProps scanProps;
@@ -91,17 +92,17 @@ JsonParser::JsonParser(
91
92
{
92
93
try {
93
94
// parse JSON
94
- pt::ptree root;
95
- read_json (input, root);
95
+ read_json (input, d->root );
96
96
97
97
// 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 ();
100
100
d->jsonValid = true ;
101
101
102
102
// read scan properties if available
103
103
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);
105
106
BOOST_FOREACH (const pt::ptree::value_type &item, scanNode)
106
107
d->scanProps [item.first ] = item.second .data ();
107
108
}
@@ -214,7 +215,7 @@ bool JsonParser::getNext(Defect *def) {
214
215
215
216
// error recovery loop
216
217
for (;;) {
217
- if (d->defList . end () == d->defIter )
218
+ if (d->defList -> end () == d->defIter )
218
219
return false ;
219
220
220
221
if (d->readNext (def))
You can’t perform that action at this time.
0 commit comments