diff --git a/library/network_connections.py b/library/network_connections.py index 2e0b4a7..1504645 100755 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -56,9 +56,8 @@ class Util: @staticmethod def first(iterable, default = None, pred = None): for v in iterable: - if pred is not None and pred(v): - continue - return v + if pred is None or pred(v): + return v return default @staticmethod