Skip to content

Commit 23891ab

Browse files
committed
deflookup: do not cache pointer to MsgFilter
Just for sanity. No change in behavior intended by this commit.
1 parent fff6f3c commit 23891ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

deflookup.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ typedef std::map<std::string, TDefByFile> TDefByChecker;
3333
struct DefLookup::Private {
3434
TDefByChecker stor;
3535
bool usePartialResults;
36-
MsgFilter *filt;
3736
};
3837

3938
DefLookup::DefLookup(const bool usePartialResults):
4039
d(new Private)
4140
{
4241
d->usePartialResults = usePartialResults;
43-
d->filt = MsgFilter::inst();
4442
}
4543

4644
DefLookup::DefLookup(const DefLookup &ref):
@@ -80,8 +78,9 @@ bool DefLookup::lookup(const Defect &def) {
8078
return false;
8179

8280
// simplify path
81+
MsgFilter *filter = MsgFilter::inst();
8382
const DefEvent &evt = def.events[def.keyEventIdx];
84-
const std::string path(d->filt->filterPath(evt.fileName));
83+
const std::string path(filter->filterPath(evt.fileName));
8584

8685
// look for file name
8786
TDefByFile &row = iRow->second;
@@ -105,7 +104,7 @@ bool DefLookup::lookup(const Defect &def) {
105104
// look by msg
106105
TDefByMsg &zCol = iZCol->second;
107106
TDefByMsg::iterator iCell = zCol.find(
108-
d->filt->filterMsg(evt.msg, def.checker));
107+
filter->filterMsg(evt.msg, def.checker));
109108
if (zCol.end() == iCell)
110109
return false;
111110

0 commit comments

Comments
 (0)