summaryrefslogtreecommitdiffstats
path: root/SCons/Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'SCons/Util.py')
-rw-r--r--SCons/Util.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/SCons/Util.py b/SCons/Util.py
index d486867..6a0f8ac 100644
--- a/SCons/Util.py
+++ b/SCons/Util.py
@@ -70,17 +70,11 @@ else:
# (Yeah, yeah, YAGNI...)
def containsAny(s, pat) -> bool:
"""Check whether string `s` contains ANY of the items in `pat`."""
- for c in pat:
- if c in s:
- return True
- return False
+ return any(c in s for c in pat)
def containsAll(s, pat) -> bool:
"""Check whether string `s` contains ALL of the items in `pat`."""
- for c in pat:
- if c not in s:
- return False
- return True
+ return all(c in s for c in pat)
def containsOnly(s, pat) -> bool:
"""Check whether string `s` contains ONLY items in `pat`."""