Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 1917203002: Remove more type casts (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 980000e4708fd318671d3b5f0561e6adf2d08289..96cdd808593604a2bafc600176d8c08141f79d40 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -143,34 +143,33 @@ class AnalysisError {
String get message => _message;
@override
- bool operator ==(Object obj) {
- if (identical(obj, this)) {
+ bool operator ==(Object other) {
+ if (identical(other, this)) {
return true;
}
// prepare other AnalysisError
- if (obj is! AnalysisError) {
- return false;
- }
- AnalysisError other = obj as AnalysisError;
- // Quick checks.
- if (!identical(errorCode, other.errorCode)) {
- return false;
- }
- if (offset != other.offset || length != other.length) {
- return false;
- }
- if (isStaticOnly != other.isStaticOnly) {
- return false;
- }
- // Deep checks.
- if (_message != other._message) {
- return false;
- }
- if (source != other.source) {
- return false;
+ if (other is AnalysisError) {
+ // Quick checks.
+ if (!identical(errorCode, other.errorCode)) {
+ return false;
+ }
+ if (offset != other.offset || length != other.length) {
+ return false;
+ }
+ if (isStaticOnly != other.isStaticOnly) {
+ return false;
+ }
+ // Deep checks.
+ if (_message != other._message) {
+ return false;
+ }
+ if (source != other.source) {
+ return false;
+ }
+ // OK
+ return true;
}
- // OK
- return true;
+ return false;
}
/**

Powered by Google App Engine
This is Rietveld 408576698