@@ -41,21 +41,26 @@ CovTreeDecoder::CovTreeDecoder(InStream &input):
4141
4242CovTreeDecoder::~CovTreeDecoder () = default ;
4343
44+ // / decode single event
45+ static DefEvent covDecodeEvt (const pt::ptree &evtNode)
46+ {
47+ DefEvent evt;
48+
49+ evt.fileName = valueOf<std::string>(evtNode, " filePathname" );
50+ evt.line = valueOf<int > (evtNode, " lineNumber" );
51+ evt.column = valueOf<int > (evtNode, " columnNumber" );
52+ evt.event = valueOf<std::string>(evtNode, " eventTag" );
53+ evt.msg = valueOf<std::string>(evtNode, " eventDescription" );
54+
55+ return evt;
56+ }
57+
4458void CovTreeDecoder::Private::readEvents (Defect *def)
4559{
4660 // go through the list of events
4761 const pt::ptree &evtList = this ->pSrc ->get_child (" events" );
4862 for (const auto &item : evtList) {
4963 const pt::ptree &evtNode = item.second ;
50-
51- // decode single event
52- DefEvent evt;
53- evt.fileName = valueOf<std::string>(evtNode, " filePathname" );
54- evt.line = valueOf<int > (evtNode, " lineNumber" );
55- evt.column = valueOf<int > (evtNode, " columnNumber" );
56- evt.event = valueOf<std::string>(evtNode, " eventTag" );
57- evt.msg = valueOf<std::string>(evtNode, " eventDescription" );
58-
5964 if (evtNode.get <bool >(" main" )) {
6065 // this is a key event
6166
@@ -70,6 +75,7 @@ void CovTreeDecoder::Private::readEvents(Defect *def)
7075 }
7176
7277 // push the event to the list of events
78+ const DefEvent evt = covDecodeEvt (evtNode);
7379 def->events .push_back (std::move (evt));
7480 }
7581}
0 commit comments