Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
bingoohuang committed Mar 23, 2018
1 parent c4e5378 commit b700b1c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public TemplateMatch match(List<Template> templates, String content) {
TemplateMatch lastMatched = null;
for (val template : templates) {
val matched = match(template, content);
if (matched.isMatched()) {
if (lastMatched == null || matched.getConsts() > lastMatched.getConsts()) {
lastMatched = matched;
}
if (!matched.isMatched()) continue;

if (lastMatched == null || matched.getConsts() > lastMatched.getConsts()) {
lastMatched = matched;
}
}

Expand Down

0 comments on commit b700b1c

Please sign in to comment.