Skip to content

Commit a84f703

Browse files
committed
perf: avoid unnecessary dict allocation in execute_async custom_payload
1 parent 8e6c4d4 commit a84f703

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cassandra/cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,8 +2751,9 @@ def execute_async(self, query, parameters=None, trace=False, custom_payload=None
27512751
... log.exception("Operation failed:")
27522752
27532753
"""
2754-
custom_payload = custom_payload if custom_payload else {}
27552754
if execute_as:
2755+
if not custom_payload:
2756+
custom_payload = {}
27562757
custom_payload[_proxy_execute_key] = execute_as.encode()
27572758

27582759
future = self._create_response_future(

0 commit comments

Comments
 (0)