mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
Use putIfAbsent in InheritanceManager._reportError.
R=brianwilkerson@google.com Review URL: https://codereview.chromium.org/2537643004 .
This commit is contained in:
parent
86866a3116
commit
af89793c11
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue