Commit d1780d81 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

perf: Use cache when calling JID.new_as_bare()

parent 5fb40a6c
Pipeline #10421 passed with stages
in 58 seconds
......@@ -700,9 +700,7 @@ class JID:
def new_as_bare(self) -> JID:
if self.resource is None:
return self
new = asdict(self)
return JID(**new)
return JID.from_string(self.bare)
def bare_match(self, other: Union[str, JID]) -> bool:
if isinstance(other, str):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment