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

Unified Diff: sdk/lib/uri/encode_decode.dart

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
Index: sdk/lib/uri/encode_decode.dart
diff --git a/sdk/lib/uri/encode_decode.dart b/sdk/lib/uri/encode_decode.dart
index 124c803a38d30318f4c334054a355da6556f7d34..6cddcc0408ba4121be92fc703c8a80c72da3e3af 100644
--- a/sdk/lib/uri/encode_decode.dart
+++ b/sdk/lib/uri/encode_decode.dart
@@ -116,9 +116,9 @@ String _uriEncode(List<int> canonicalTable, String text) {
for (int i = 0; i < text.length; i++) {
int ch = text.codeUnitAt(i);
if (ch < 128 && ((canonicalTable[ch >> 4] & (1 << (ch & 0x0f))) != 0)) {
- result.add(text[i]);
+ result.write(text[i]);
} else if (text[i] == " ") {
- result.add("+");
+ result.write("+");
} else {
if (ch >= 0xD800 && ch < 0xDC00) {
// Low surrogate. We expect a next char high surrogate.
@@ -132,7 +132,7 @@ String _uriEncode(List<int> canonicalTable, String text) {
}
}
for (int codepoint in codepointsToUtf8([ch])) {
- result.add(byteToHex(codepoint));
+ result.write(byteToHex(codepoint));
}
}
}
@@ -173,9 +173,9 @@ String _uriDecode(String text) {
String ch = text[i];
if (ch != '%') {
if (ch == '+') {
- result.add(" ");
+ result.write(" ");
} else {
- result.add(ch);
+ result.write(ch);
}
i++;
} else {
@@ -190,7 +190,7 @@ String _uriDecode(String text) {
break;
ch = text[i];
}
- result.add(decodeUtf8(codepoints));
+ result.write(decodeUtf8(codepoints));
}
}
return result.toString();

Powered by Google App Engine
This is Rietveld 408576698