Project

General

Profile

Task #4120

In RegexComponentSetMatcher, m_components can be a vector

Added by Jeff Thompson over 3 years ago. Updated about 3 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.)

#1

Updated by Junxiao Shi over 3 years ago

  • Category set to Utils
#2

Updated by Davide Pesavento about 3 years ago

  • Status changed from New to Code review
  • Assignee set to Davide Pesavento
  • Target version set to v0.7
  • Start date deleted (06/07/2017)
  • % Done changed from 0 to 100
#3

Updated by Davide Pesavento about 3 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF