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

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

Issue 922383002: Replace using runtimeType with 'is'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element.dart
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index ebfbcaccd6261931db4111dd1420a92b8d791271..1879700fa69061607f17c1437647467428f45a74 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -1498,9 +1498,7 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl implements
@override
bool operator ==(Object object) =>
- object != null &&
- runtimeType == object.runtimeType &&
- source == (object as CompilationUnitElementImpl).source;
+ object is CompilationUnitElementImpl && source == object.source;
@override
accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this);
@@ -4814,10 +4812,12 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
// Generate the hashCode
int code = (returnType as TypeImpl).internalHashCode(visitedTypes);
for (int i = 0; i < normalParameterTypes.length; i++) {
- code = (code << 1) + (normalParameterTypes[i] as TypeImpl).internalHashCode(visitedTypes);
+ code = (code << 1) +
+ (normalParameterTypes[i] as TypeImpl).internalHashCode(visitedTypes);
}
for (int i = 0; i < optionalParameterTypes.length; i++) {
- code = (code << 1) + (optionalParameterTypes[i] as TypeImpl).internalHashCode(visitedTypes);
+ code = (code << 1) +
+ (optionalParameterTypes[i] as TypeImpl).internalHashCode(visitedTypes);
}
for (DartType type in namedParameterTypes) {
code = (code << 1) + (type as TypeImpl).internalHashCode(visitedTypes);
@@ -5654,11 +5654,7 @@ class HtmlElementImpl extends ElementImpl implements HtmlElement {
if (identical(object, this)) {
return true;
}
- if (object == null) {
- return false;
- }
- return runtimeType == object.runtimeType &&
- source == (object as HtmlElementImpl).source;
+ return object is HtmlElementImpl && source == object.source;
}
@override
@@ -7594,10 +7590,8 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
@override
bool operator ==(Object object) =>
- object != null &&
- runtimeType == object.runtimeType &&
- _definingCompilationUnit ==
- (object as LibraryElementImpl).definingCompilationUnit;
+ object is LibraryElementImpl &&
+ _definingCompilationUnit == object.definingCompilationUnit;
@override
accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698