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

Unified Diff: lib/uri/uri.dart

Issue 9662051: - Remove String + operator in uri.dart. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« 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: lib/uri/uri.dart
===================================================================
--- lib/uri/uri.dart (revision 5311)
+++ lib/uri/uri.dart (working copy)
@@ -44,23 +44,23 @@
// NOTE: This code was ported from: closure-library/closure/goog/uri/utils.js
static final RegExp _splitRe = const RegExp(
- '^' +
- '(?:' +
- '([^:/?#.]+)' + // scheme - ignore special characters
+ '^'
+ '(?:'
+ '([^:/?#.]+)' // scheme - ignore special characters
// used by other URL parts such as :,
// ?, /, #, and .
- ':)?' +
- '(?://' +
- '(?:([^/?#]*)@)?' + // userInfo
- '([\\w\\d\\-\\u0100-\\uffff.%]*)' +
+ ':)?'
+ '(?://'
+ '(?:([^/?#]*)@)?' // userInfo
+ '([\\w\\d\\-\\u0100-\\uffff.%]*)'
// domain - restrict to letters,
// digits, dashes, dots, percent
// escapes, and unicode characters.
- '(?::([0-9]+))?' + // port
- ')?' +
- '([^?#]+)?' + // path
- '(?:\\?([^#]*))?' + // query
- '(?:#(.*))?' + // fragment
+ '(?::([0-9]+))?' // port
+ ')?'
+ '([^?#]+)?' // path
+ '(?:\\?([^#]*))?' // query
+ '(?:#(.*))?' // fragment
'\$');
static final _COMPONENT_SCHEME = 1;
@@ -192,7 +192,7 @@
String merge(String base, String reference) {
if (base == "") return "/$reference";
- return base.substring(0, base.lastIndexOf("/") + 1) + "$reference";
+ return "${base.substring(0, base.lastIndexOf('/') + 1)}$reference";
}
String removeDotSegments(String path) {
« 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