ruff: Fix SIM111 Use `return all(…)` instead of `for` loop.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-01-04 22:22:44 -08:00 committed by Tim Abbott
parent b8b29dc3ad
commit c6b6004432
1 changed files with 1 additions and 4 deletions

View File

@ -103,10 +103,7 @@ def generate_emoji_catalog(
# Use only those names for which images are present in all # Use only those names for which images are present in all
# the emoji sets so that we can switch emoji sets seamlessly. # the emoji sets so that we can switch emoji sets seamlessly.
def emoji_is_universal(emoji_dict: Dict[str, Any]) -> bool: def emoji_is_universal(emoji_dict: Dict[str, Any]) -> bool:
for emoji_set in EMOJISETS: return all(emoji_dict["has_img_" + emoji_set] for emoji_set in EMOJISETS)
if not emoji_dict["has_img_" + emoji_set]:
return False
return True
def generate_codepoint_to_name_map(emoji_name_maps: Dict[str, Dict[str, Any]]) -> Dict[str, str]: def generate_codepoint_to_name_map(emoji_name_maps: Dict[str, Dict[str, Any]]) -> Dict[str, str]: