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

Unified Diff: runtime/lib/string_patch.dart

Issue 957743002: Cleanup URI and use String.replaceRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « no previous file | sdk/lib/core/uri.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index e3f5c68d923d8b28cad4dcb9425b7ed91fa37f0a..11db8fe066a8f4e74ede1e9d314ac6427f612edf 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -579,6 +579,7 @@ class _StringBase {
int length = this.length;
end = RangeError.checkValidRange(start, end, length);
bool replacementIsOneByte = replacement._isOneByte;
+ if (start == 0 && end == length) return replacement;
int replacementLength = replacement.length;
int totalLength = start + (length - end) + replacementLength;
if (replacementIsOneByte && this._isOneByte) {
« no previous file with comments | « no previous file | sdk/lib/core/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698