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

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

Issue 2245323004: Make Uri._makeQuery easier to analyze (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: nest ifs Created 4 years, 4 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: sdk/lib/core/uri.dart
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index 51d66cfa8052a64fb1ad6235f4afee31e1c4a918..d7f911bfa55d98e782e3be82b6730191046c91b2 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -2066,11 +2066,13 @@ class _Uri implements Uri {
static String _makeQuery(
String query, int start, int end,
Map<String, dynamic/*String|Iterable<String>*/> queryParameters) {
- if (query == null && queryParameters == null) return null;
- if (query != null && queryParameters != null) {
- throw new ArgumentError('Both query and queryParameters specified');
+ if (query != null) {
+ if (queryParameters != null) {
+ throw new ArgumentError('Both query and queryParameters specified');
+ }
+ return _normalize(query, start, end, _queryCharTable);
}
- if (query != null) return _normalize(query, start, end, _queryCharTable);
+ if (queryParameters == null) return null;
var result = new StringBuffer();
var separator = "";
« 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