Index: pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart |
diff --git a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart |
index ba9d1ff9684dba3a617a075a45e421f5347ed34a..69d3948ded0b4ec95e4711eca38ec0a01b067572 100644 |
--- a/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart |
+++ b/pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart |
@@ -669,11 +669,8 @@ class InheritanceManager { |
if (ignoreErrors) { |
return; |
} |
- HashSet<AnalysisError> errorSet = _errorsInClassElement[classElt]; |
- if (errorSet == null) { |
- errorSet = new HashSet<AnalysisError>(); |
- _errorsInClassElement[classElt] = errorSet; |
- } |
+ HashSet<AnalysisError> errorSet = _errorsInClassElement.putIfAbsent( |
+ classElt, () => new HashSet<AnalysisError>()); |
errorSet.add(new AnalysisError(classElt.source, classElt.nameOffset, |
classElt.nameLength, errorCode, arguments)); |
} |