Skip to content

Commit da64c26

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 20d6001 commit da64c26

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
@@ -13,9 +13,8 @@ import 'byte_stream.dart';
1313
/// mapToQuery({"foo": "bar", "baz": "bang"});
1414
/// //=> "foo=bar&baz=bang"
1515
String mapToQuery(Map<String, String> map, {Encoding encoding}) {
16-
map.keys
17-
.where((k) => (map[k] == null)).toList() // -- keys for null elements
18-
.forEach(map.remove);
16+
var nullKeys = map.keys.where((k) => (map[k] == null)).toList();
17+
nullKeys.forEach(map.remove); // -- remove elements with null values
1918

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

0 commit comments

Comments
 (0)