Project

General

Profile

Actions

Task #4120

closed

In RegexComponentSetMatcher, m_components can be a vector

Added by Anonymous over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Low
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

In RegexComponentSetMatcher, m_components is a set<shared_ptr<RegexComponentMatcher> > .
https://github.com/named-data/ndn-cxx/blob/18cf81bf6e03fe518b4f2e9d0c02223276be2cf7/src/util/regex/regex-component-set-matcher.hpp#L71

But each added member is a new, different shared_ptr:
https://github.com/named-data/ndn-cxx/blob/18cf81bf6e03fe518b4f2e9d0c02223276be2cf7/src/util/regex/regex-component-set-matcher.hpp#L135

Different shared_ptr always compare unequal, so adding to the set always adds a new member. Therefore, m_components can be a vector, which is more efficient, and less confusing since it really doesn't maintain set behavior.

(This issue is just an observation. You can abandon it if you want.)

Actions

Also available in: Atom PDF