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

Side by Side Diff: pkg/oauth2/lib/src/utils.dart

Issue 12090093: Reapply "Rename mappedBy to map." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug in previous commit. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/intl/test/date_time_format_test_core.dart ('k') | pkg/path/lib/path.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library utils; 5 library utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:uri'; 8 import 'dart:uri';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:crypto'; 10 import 'dart:crypto';
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 /// Convert a [Map] from parameter names to values to a URL query string. 34 /// Convert a [Map] from parameter names to values to a URL query string.
35 String mapToQuery(Map<String, String> map) { 35 String mapToQuery(Map<String, String> map) {
36 var pairs = <List<String>>[]; 36 var pairs = <List<String>>[];
37 map.forEach((key, value) { 37 map.forEach((key, value) {
38 key = encodeUriComponent(key); 38 key = encodeUriComponent(key);
39 value = (value == null || value.isEmpty) ? null : encodeUriComponent(value); 39 value = (value == null || value.isEmpty) ? null : encodeUriComponent(value);
40 pairs.add([key, value]); 40 pairs.add([key, value]);
41 }); 41 });
42 return Strings.join(pairs.mappedBy((pair) { 42 return Strings.join(pairs.map((pair) {
43 if (pair[1] == null) return pair[0]; 43 if (pair[1] == null) return pair[0];
44 return "${pair[0]}=${pair[1]}"; 44 return "${pair[0]}=${pair[1]}";
45 }), "&"); 45 }), "&");
46 } 46 }
47 47
48 /// Add all key/value pairs from [source] to [destination], overwriting any 48 /// Add all key/value pairs from [source] to [destination], overwriting any
49 /// pre-existing values. 49 /// pre-existing values.
50 void mapAddAll(Map destination, Map source) => 50 void mapAddAll(Map destination, Map source) =>
51 source.forEach((key, value) => destination[key] = value); 51 source.forEach((key, value) => destination[key] = value);
52 52
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (!paramString.trim().isEmpty) { 107 if (!paramString.trim().isEmpty) {
108 throw new FormatException('Invalid WWW-Authenticate header: "$header"'); 108 throw new FormatException('Invalid WWW-Authenticate header: "$header"');
109 } 109 }
110 110
111 return new AuthenticateHeader(scheme, parameters); 111 return new AuthenticateHeader(scheme, parameters);
112 } 112 }
113 } 113 }
114 114
115 /// Returns a [Future] that asynchronously completes to `null`. 115 /// Returns a [Future] that asynchronously completes to `null`.
116 Future get async => new Future.delayed(0, () => null); 116 Future get async => new Future.delayed(0, () => null);
OLDNEW
« no previous file with comments | « pkg/intl/test/date_time_format_test_core.dart ('k') | pkg/path/lib/path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698