Skip to content

Commit 3fffb44

Browse files
committed
Refactor handling of null request values as per PR comments. See: https://github.com/dart-lang/http/pull/77/files/26e6075d93a41f381012b1588b2f4ccb056e9231
1 parent 1786d37 commit 3fffb44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/src/utils.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ Map/*<K, V>*/ updateMap/*<K, V>*/(
3030
/// mapToQuery({"foo": "bar", "baz": "bang"});
3131
/// //=> "foo=bar&baz=bang"
3232
String mapToQuery(Map<String, String> map, {Encoding encoding}) {
33-
map.keys
34-
.where((k) => (map[k] == null)).toList() // -- keys for null elements
35-
.forEach(map.remove);
33+
var nullKeys = map.keys.where((k) => (map[k] == null)).toList();
34+
nullKeys.forEach(map.remove); // -- remove elements with null values
3635

3736
var pairs = <List<String>>[];
3837
map.forEach((key, value) =>

0 commit comments

Comments
 (0)