Chromium Code Reviews| Index: lib/kernel.dart |
| diff --git a/lib/kernel.dart b/lib/kernel.dart |
| index 0910767a17ad4e1bde5d89bf3ed1c85b118246d5..c082c408cf0b2ac62486886941bf15f325150588 100644 |
| --- a/lib/kernel.dart |
| +++ b/lib/kernel.dart |
| @@ -83,7 +83,8 @@ class Kernel { |
| final Set<ir.TreeNode> checkedNodes = new Set<ir.TreeNode>(); |
| - final Map<String, int> mixinApplicationNames = <String, int>{}; |
| + final Map<LibraryElement, Map<String, int>> mixinApplicationNamesByLibrary = |
| + <LibraryElement, Map<String, int>>{}; |
| /// FIFO queue of work that needs to be completed before the returned AST |
| /// nodes are correct. |
| @@ -185,6 +186,9 @@ class Kernel { |
| String computeName(ClassElement cls) { |
| String name = cls.name; |
| if (!cls.isUnnamedMixinApplication) return name; |
| + Map<String, int> mixinApplicationNames = |
| + mixinApplicationNamesByLibrary.putIfAbsent( |
| + cls.library.implementation, () => <String, int>{}); |
| mixinApplicationNames.putIfAbsent(name, () => 0); |
|
kasperl
2016/07/01 13:05:14
int count = mixinApplicationNames.putIfAbsent(name
ahe
2016/07/01 13:14:15
I like that better.
|
| int count = mixinApplicationNames[name]++; |
| return "$name#$count"; |