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 #1

Updated by Junxiao Shi over 7 years ago

  • Category set to Utils
Actions #2

Updated by Davide Pesavento almost 7 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
Actions #3

Updated by Davide Pesavento almost 7 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF