Skip to content

Commit

Permalink
Save ~13% execution time in []RuleClassProvider.create() by only form…
Browse files Browse the repository at this point in the history
…atting strings if the result will be used.

This is about 120-130ms.

--
MOS_MIGRATED_REVID=88397372
  • Loading branch information
Googler authored and hanwen committed Mar 13, 2015
1 parent 08ec257 commit 2935d67
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@ public Builder(String name, RuleClassType type, boolean skylark, RuleClass... pa
String attrName = attribute.getName();
Preconditions.checkArgument(
!attributes.containsKey(attrName) || attributes.get(attrName) == attribute,
String.format("Attribute %s is inherited multiple times in %s ruleclass",
attrName, name));
"Attribute %s is inherited multiple times in %s ruleclass",
attrName,
name);
attributes.put(attrName, attribute);
}
}
Expand Down

0 comments on commit 2935d67

Please sign in to comment.