diff options
author | Erik Johnston <erik@matrix.org> | 2015-01-06 18:51:03 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-01-06 18:51:03 +0000 |
commit | dfa05f0cd69779f21ae9b1085c40079440f87d3b (patch) | |
tree | 5bda263705c0bf37b0aff8e60aab2662f3fc578f /synapse/util/frozenutils.py | |
parent | Use time.time() instead of time.clock() (diff) | |
download | synapse-dfa05f0cd69779f21ae9b1085c40079440f87d3b.tar.xz |
Optimize FrozenEvent creation
Diffstat (limited to '')
-rw-r--r-- | synapse/util/frozenutils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/util/frozenutils.py b/synapse/util/frozenutils.py index 061f79d79d..a13a2015e4 100644 --- a/synapse/util/frozenutils.py +++ b/synapse/util/frozenutils.py @@ -17,10 +17,11 @@ from frozendict import frozendict def freeze(o): - if isinstance(o, dict) or isinstance(o, frozendict): + t = type(o) + if t is dict: return frozendict({k: freeze(v) for k, v in o.items()}) - if isinstance(o, basestring): + if t is str or t is unicode: return o try: |