Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix PERF402 Use `list` or `list.copy` to create a copy of a list.

Anders Kaseorg0b95d83f099a
diff --git a/puppet/zulip/files/postgresql/wal-g-exporter b/puppet/zulip/files/postgresql/wal-g-exporter
index 7d422ad057b..c0e7a9565cb 100755
--- a/puppet/zulip/files/postgresql/wal-g-exporter
+++ b/puppet/zulip/files/postgresql/wal-g-exporter
@@ -49,8 +49,7 @@ class WalGPrometheusServer(BaseHTTPRequestHandler):
if self.metric_values[metric_name]:
# Print preamble
lines += self.metrics[metric_name]
- for metric_value in self.metric_values[metric_name].values():
- lines.append(metric_value)
+ lines += self.metric_values[metric_name].values()
lines.append("")
self.wfile.write("\n".join(lines).encode())
diff --git a/tools/setup/emoji/emoji_setup_utils.py b/tools/setup/emoji/emoji_setup_utils.py
index cbb06d2adea..2baa139e725 100644
--- a/tools/setup/emoji/emoji_setup_utils.py
+++ b/tools/setup/emoji/emoji_setup_utils.py
@@ -116,14 +116,11 @@ def generate_codepoint_to_name_map(emoji_name_maps: Dict[str, Dict[str, Any]]) -
def generate_codepoint_to_names_map(
emoji_name_maps: Dict[str, Dict[str, Any]]
) -> Dict[str, List[str]]:
- codepoint_to_names: Dict[str, List[str]] = {}
- for emoji_code, name_info in emoji_name_maps.items():
- # The first element of the names list is always the canonical name.
- names = [name_info["canonical_name"]]
- for alias in name_info["aliases"]:
- names.append(alias)
- codepoint_to_names[emoji_code] = names
- return codepoint_to_names
+ # The first element of the names list is always the canonical name.
+ return {
+ emoji_code: [name_info["canonical_name"], *name_info["aliases"]]
+ for emoji_code, name_info in emoji_name_maps.items()
+ }
def generate_name_to_codepoint_map(emoji_name_maps: Dict[str, Dict[str, Any]]) -> Dict[str, str]: