diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 4acff34248..18079dbd4e 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -13,9 +13,8 @@ import 'byte_stream.dart'; /// mapToQuery({"foo": "bar", "baz": "bang"}); /// //=> "foo=bar&baz=bang" String mapToQuery(Map map, {Encoding encoding}) { - map.keys - .where((k) => (map[k] == null)).toList() // -- keys for null elements - .forEach(map.remove); + var nullKeys = map.keys.where((k) => (map[k] == null)).toList(); + nullKeys.forEach(map.remove); // -- remove elements with null values var pairs = >[]; map.forEach((key, value) =>