mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -294,7 +294,7 @@ def get_topic_resolution_and_bare_name(stored_name: str) -> tuple[bool, str]:
|
||||
- The topic name with the resolution prefix, if present in stored_name, removed
|
||||
"""
|
||||
if stored_name.startswith(RESOLVED_TOPIC_PREFIX):
|
||||
return (True, stored_name[len(RESOLVED_TOPIC_PREFIX) :])
|
||||
return (True, stored_name.removeprefix(RESOLVED_TOPIC_PREFIX))
|
||||
|
||||
return (False, stored_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user