aboutsummaryrefslogtreecommitdiff
path: root/dep.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-29 16:05:44 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-29 16:06:39 +0900
commitf772b17d24ed25314dff5e30ac548ed19b9c265a (patch)
treec78a8b203041c7ee21e1182b563d90f2b3642054 /dep.cc
parentdf1fc8b2ead00bad8c23065affb9576a4b03cff5 (diff)
[C++] Fix implicit_pattern_rule_prefix.mk
Diffstat (limited to 'dep.cc')
-rw-r--r--dep.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/dep.cc b/dep.cc
index 033cab2..5881ab6 100644
--- a/dep.cc
+++ b/dep.cc
@@ -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 {