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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 960653003: Use String.replaceRange() instead of concatenation. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index e5349433b8b7b9bfa4edd159b04cc0ff240e2d42..1f6f849d5c0af38f207f3cce5f17c287048c84f6 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -73,9 +73,7 @@ String _applyEdit(String code, SourceEdit edit) {
if (edit.length < 0) {
throw new RangeError('length is negative');
}
- return code.substring(0, edit.offset) +
- edit.replacement +
- code.substring(edit.end);
+ return code.replaceRange(edit.offset, edit.end, edit.replacement);
}
/**
« 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