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

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

Issue 428303004: Breaking changes in 'analyzer' package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename Source.resolveRelative to resolveRelativeUri, soften version constraints Created 6 years, 4 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 | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | 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 166fc822188b0287e39d96d809bfa60750d6c9b8..63d844d0089e1542106a1209bcc849c57f948b29 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -3784,17 +3784,11 @@ class ElementLocationImpl implements ElementLocation {
if (otherComponents.length != length) {
return false;
}
- for (int i = length - 1; i >= 2; i--) {
+ for (int i = 0; i < length; i++) {
if (_components[i] != otherComponents[i]) {
return false;
}
}
- if (length > 1 && !_equalSourceComponents(_components[1], otherComponents[1])) {
- return false;
- }
- if (length > 0 && !_equalSourceComponents(_components[0], otherComponents[0])) {
- return false;
- }
return true;
}
@@ -3819,13 +3813,7 @@ class ElementLocationImpl implements ElementLocation {
int result = 1;
for (int i = 0; i < _components.length; i++) {
String component = _components[i];
- int componentHash;
- if (i <= 1) {
- componentHash = _hashSourceComponent(component);
- } else {
- componentHash = component.hashCode;
- }
- result = 31 * result + componentHash;
+ result = 31 * result + component.hashCode;
}
return result;
}
@@ -3880,45 +3868,6 @@ class ElementLocationImpl implements ElementLocation {
builder.appendChar(currentChar);
}
}
-
- /**
- * Return `true` if the given components, when interpreted to be encoded sources with a
- * leading source type indicator, are equal when the source type's are ignored.
- *
- * @param left the left component being compared
- * @param right the right component being compared
- * @return `true` if the given components are equal when the source type's are ignored
- */
- bool _equalSourceComponents(String left, String right) {
- // TODO(brianwilkerson) This method can go away when sources no longer have a URI kind.
- if (left == null) {
- return right == null;
- } else if (right == null) {
- return false;
- }
- int leftLength = left.length;
- int rightLength = right.length;
- if (leftLength != rightLength) {
- return false;
- } else if (leftLength <= 1 || rightLength <= 1) {
- return left == right;
- }
- return javaStringRegionMatches(left, 1, right, 1, leftLength - 1);
- }
-
- /**
- * Return the hash code of the given encoded source component, ignoring the source type indicator.
- *
- * @param sourceComponent the component to compute a hash code
- * @return the hash code of the given encoded source component
- */
- int _hashSourceComponent(String sourceComponent) {
- // TODO(brianwilkerson) This method can go away when sources no longer have a URI kind.
- if (sourceComponent.length <= 1) {
- return sourceComponent.hashCode;
- }
- return sourceComponent.substring(1).hashCode;
- }
}
/**
@@ -10986,11 +10935,6 @@ class TypeParameterTypeImpl extends TypeImpl implements TypeParameterType {
if (this == s) {
return true;
}
- // S is bottom.
- //
- if (s.isBottom) {
- return true;
- }
// S is dynamic.
//
if (s.isDynamic) {
« no previous file with comments | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698