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

Unified Diff: sdk/lib/_internal/js_runtime/lib/core_patch.dart

Issue 1420303011: dart2js Uri patch: avoid unnecessary code-unit to String conversions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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: sdk/lib/_internal/js_runtime/lib/core_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index a9832709b21b2fe46243d8e73e18eb8874e2c62c..d55524211342d233eaaec77493a5b3ad8833a037 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -558,12 +558,12 @@ class Uri {
((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
result.writeCharCode(byte);
} else if (spaceToPlus && byte == _SPACE) {
- result.writeCharCode(_PLUS);
+ result.write('+');
} else {
const String hexDigits = '0123456789ABCDEF';
- result.writeCharCode(_PERCENT);
- result.writeCharCode(hexDigits.codeUnitAt(byte >> 4));
- result.writeCharCode(hexDigits.codeUnitAt(byte & 0x0f));
+ result.write('%');
+ result.write(hexDigits[(byte >> 4) & 0x0f]);
+ result.write(hexDigits[byte & 0x0f]);
Lasse Reichstein Nielsen 2015/11/05 21:48:26 I guess it's OK, but it's a sign that dart2js' Str
sra1 2015/11/06 01:55:10 It is really hard to get JavaScript performance wi
}
}
return result.toString();
« 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