diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-08-02 18:15:14 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-08-02 18:44:02 +0300 |
commit | b186a2182172facf50c8186559008bab90c19b12 (patch) | |
tree | 38e246bced57e1796fe74447b7be5d113327200a /obnamlib/fmt_ga/tree.py | |
parent | 80474a5fbb0264b0283e223d896afb267fcea333 (diff) | |
download | obnam-b186a2182172facf50c8186559008bab90c19b12.tar.gz |
Avoid looking up in dir_obj cache twice
Diffstat (limited to 'obnamlib/fmt_ga/tree.py')
-rw-r--r-- | obnamlib/fmt_ga/tree.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/obnamlib/fmt_ga/tree.py b/obnamlib/fmt_ga/tree.py index 1c59ceed..54c1e942 100644 --- a/obnamlib/fmt_ga/tree.py +++ b/obnamlib/fmt_ga/tree.py @@ -52,8 +52,9 @@ class GATree(object): return self._root_dir_id def get_directory(self, pathname): - if pathname in self._cache: - return self._cache.get(pathname) + dir_obj = self._cache.get(pathname) + if dir_obj is not None: + return dir_obj if self._root_dir_id is None: return None |