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

Unified Diff: pkg/compiler/lib/src/js_emitter/constant_ordering.dart

Issue 2864363002: Remove DartString from constants. (Closed)
Patch Set: Remove toDartString Created 3 years, 7 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/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/mirrors_used.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/constant_ordering.dart
diff --git a/pkg/compiler/lib/src/js_emitter/constant_ordering.dart b/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
index 50aa2ba76f8331e2911edddd874ed0c881427a68..a1b0903aca5af3094375539c3d5564ea026a514a 100644
--- a/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
+++ b/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
@@ -9,7 +9,6 @@ import '../elements/elements.dart' show Elements;
import '../elements/entities.dart' show Entity, FieldEntity;
import '../elements/resolution_types.dart';
import '../js_backend/js_backend.dart' show SyntheticConstantKind;
-import '../tree/dartstring.dart' show DartString;
/// A canonical but arbitrary ordering of constants. The ordering is 'stable'
/// under perturbation of the source.
@@ -95,11 +94,9 @@ class _CompareVisitor implements ConstantValueVisitor<int, ConstantValue> {
}
int visitString(StringConstantValue a, StringConstantValue b) {
- DartString aString = a.primitiveValue;
- DartString bString = b.primitiveValue;
- int r = aString.length.compareTo(bString.length);
- if (r != 0) return r;
- return aString.slowToString().compareTo(bString.slowToString());
+ String aString = a.primitiveValue;
+ String bString = b.primitiveValue;
+ return aString.compareTo(bString);
}
int visitList(ListConstantValue a, ListConstantValue b) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/mirrors_used.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698