diff options
| author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-29 16:05:44 +0900 |
|---|---|---|
| committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-29 16:06:39 +0900 |
| commit | f772b17d24ed25314dff5e30ac548ed19b9c265a (patch) | |
| tree | c78a8b203041c7ee21e1182b563d90f2b3642054 /dep.cc | |
| parent | df1fc8b2ead00bad8c23065affb9576a4b03cff5 (diff) | |
[C++] Fix implicit_pattern_rule_prefix.mk
Diffstat (limited to 'dep.cc')
| -rw-r--r-- | dep.cc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -70,13 +70,19 @@ class RuleTrie { p.first->second->Add(name.substr(1), rule); } - void Get(StringPiece name, vector<shared_ptr<Rule>>* rules) { + void Get(StringPiece name, vector<shared_ptr<Rule>>* rules) const { for (const Entry& ent : rules_) { if ((ent.suffix.empty() && name.empty()) || HasSuffix(name, ent.suffix.substr(1))) { rules->push_back(ent.rule); } } + if (name.empty()) + return; + auto found = children_.find(name[0]); + if (found != children_.end()) { + found->second->Get(name.substr(1), rules); + } } size_t size() const { |
