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

Unified Diff: third_party/pkg/route_hierarchical/lib/client.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « third_party/pkg/route_hierarchical/REVISION ('k') | third_party/pkg/route_hierarchical/lib/pattern.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/route_hierarchical/lib/client.dart
diff --git a/third_party/pkg/route_hierarchical/lib/client.dart b/third_party/pkg/route_hierarchical/lib/client.dart
index 45cbd0212cb30ee93e2c8671bc541d8b4f4b2a2a..14d737fa8dc03b6d3f52227c4e872411953a28e6 100644
--- a/third_party/pkg/route_hierarchical/lib/client.dart
+++ b/third_party/pkg/route_hierarchical/lib/client.dart
@@ -517,12 +517,11 @@ class Router {
}
List _matchingRoutes(String path, RouteImpl baseRoute) {
- var routes = baseRoute._routes.values
- .where((r) => r.path.match(path) != null)
- .toList();
-
- return sortRoutes ?
- (routes..sort((r1, r2) => r1.path.compareTo(r2.path))) : routes;
+ var routes = baseRoute._routes.values.toList();
+ if (sortRoutes) {
+ routes.sort((r1, r2) => r1.path.compareTo(r2.path));
+ }
+ return routes.where((r) => r.path.match(path) != null).toList();
}
List<_Match> _matchingTreePath(String path, RouteImpl baseRoute) {
@@ -613,15 +612,14 @@ class Router {
return params;
}
- List<String> _parseKeyVal(kvPair) {
- if (kvPair.isEmpty) {
- return const ['', ''];
- }
- var splitPoint = kvPair.indexOf('=');
-
- return (splitPoint == -1) ?
- [kvPair, '']
- : [kvPair.substring(0, splitPoint), kvPair.substring(splitPoint + 1)];
+ List<String> _parseKeyVal(keyValPair) {
+ if (keyValPair.isEmpty) return const ['', ''];
+ var splitPoint = keyValPair.indexOf('=') == -1 ?
+ keyValPair.length : keyValPair.indexOf('=') + 1;
+ var key = keyValPair.substring(0, splitPoint +
+ (keyValPair.indexOf('=') == -1 ? 0 : -1));
+ var value = keyValPair.substring(splitPoint);
+ return [key, value];
}
void _unsetAllCurrentRoutes(RouteImpl r) {
« no previous file with comments | « third_party/pkg/route_hierarchical/REVISION ('k') | third_party/pkg/route_hierarchical/lib/pattern.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698