Skip to content

Commit

Permalink
Refactor handling of null request values as per PR comments. See: htt…
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjackman committed Apr 18, 2017
1 parent 20d6001 commit da64c26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import 'byte_stream.dart';
/// mapToQuery({"foo": "bar", "baz": "bang"});
/// //=> "foo=bar&baz=bang"
String mapToQuery(Map<String, String> 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 = <List<String>>[];
map.forEach((key, value) =>
Expand Down

0 comments on commit da64c26

Please sign in to comment.