Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
d1780d81 by lovetox at 2022-07-10T17:42:47+02:00
perf: Use cache when calling JID.new_as_bare()

- - - - -


1 changed file:

- nbxmpp/protocol.py


Changes:

=====================================
nbxmpp/protocol.py
=====================================
@@ -700,9 +700,7 @@ class JID:
     def new_as_bare(self) -> JID:
         if self.resource is None:
             return self
-        new = asdict(self)
-        new.pop('resource')
-        return JID(**new)
+        return JID.from_string(self.bare)
 
     def bare_match(self, other: Union[str, JID]) -> bool:
         if isinstance(other, str):



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/d1780d814db35b02f72ac4452ae9b6dbe9a6cfea

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/d1780d814db35b02f72ac4452ae9b6dbe9a6cfea
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to