Skip to content
Snippets Groups Projects
Commit 7667ff67 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Add cache

parent ebe4589a
No related branches found
No related tags found
1 merge request!27Refactor offline I/O
...@@ -503,7 +503,8 @@ class Usr: ...@@ -503,7 +503,8 @@ class Usr:
# which has a different strucuter and key (usr_data) # which has a different strucuter and key (usr_data)
# We do not support those... # We do not support those...
self._usr_names = [ self._usr_names = [
n.decode("utf-8") for n in tree['usr_names'].lazyarray()[0] n.decode("utf-8") for n in tree['usr_names'].lazyarray(
basketcache=BASKET_CACHE)[0]
] ]
except (KeyError, IndexError): # e.g. old aanet files except (KeyError, IndexError): # e.g. old aanet files
self._usr_names = [] self._usr_names = []
...@@ -665,8 +666,8 @@ class Branch: ...@@ -665,8 +666,8 @@ class Branch:
elif isinstance(self._index, int): elif isinstance(self._index, int):
return 1 return 1
else: else:
return len( return len(self._branch[self._keymap['id']].lazyarray(
self._branch[self._keymap['id']].lazyarray()[self._index]) basketcache=BASKET_CACHE)[self._index])
def __str__(self): def __str__(self):
return "Number of elements: {}".format(len(self._branch)) return "Number of elements: {}".format(len(self._branch))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment