Skip to content

Commit b07ff80

Browse files
committed
json-writer: factorize out appendDefectNode() helper
No changes in behavior intended by this commit.
1 parent 7d1273d commit b07ff80

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

json-writer.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void JsonWriter::setScanProps(const TScanProps &scanProps) {
5252
d->scanProps = scanProps;
5353
}
5454

55-
void JsonWriter::handleDef(const Defect &def) {
55+
void appendDefectNode(boost::property_tree::ptree &dst, const Defect &def) {
5656
using std::string;
5757

5858
// go through events
@@ -93,7 +93,11 @@ void JsonWriter::handleDef(const Defect &def) {
9393
defNode.put_child("events", evtList);
9494

9595
// append the node to the list
96-
d->defList.push_back(std::make_pair("", defNode));
96+
dst.push_back(std::make_pair("", defNode));
97+
}
98+
99+
void JsonWriter::handleDef(const Defect &def) {
100+
appendDefectNode(d->defList, def);
97101
}
98102

99103
void JsonWriter::flush() {

0 commit comments

Comments
 (0)