mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
dart2js Uri patch: avoid unnecessary code-unit to String conversions
results in: H.Primitives_stringFromCharCode(C.JSString_methods.codeUnitAt$1("0123456789ABCDEF", $byte & 15) --> "0123456789ABCDEF"[$byte & 15] dart2js does not know how to do this yet. R=lrn@google.com Review URL: https://codereview.chromium.org/1420303011 .
This commit is contained in:
parent
42b9d7b702
commit
b3a4cc337c
|
@ -558,12 +558,12 @@ class Uri {
|
||||||
((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
|
((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
|
||||||
result.writeCharCode(byte);
|
result.writeCharCode(byte);
|
||||||
} else if (spaceToPlus && byte == _SPACE) {
|
} else if (spaceToPlus && byte == _SPACE) {
|
||||||
result.writeCharCode(_PLUS);
|
result.write('+');
|
||||||
} else {
|
} else {
|
||||||
const String hexDigits = '0123456789ABCDEF';
|
const String hexDigits = '0123456789ABCDEF';
|
||||||
result.writeCharCode(_PERCENT);
|
result.write('%');
|
||||||
result.writeCharCode(hexDigits.codeUnitAt(byte >> 4));
|
result.write(hexDigits[(byte >> 4) & 0x0f]);
|
||||||
result.writeCharCode(hexDigits.codeUnitAt(byte & 0x0f));
|
result.write(hexDigits[byte & 0x0f]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|
Loading…
Reference in a new issue