Don't call filenode.get_size() twice. refs #1634
authorDaira Hopwood <daira@jacaranda.org>
Fri, 10 Oct 2014 19:36:08 +0000 (20:36 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 10 Oct 2014 19:36:08 +0000 (20:36 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/web/common.py

index 2c8732066ba7544d5b2b5bfc0df8f910442ed5df..af5f6d26a7adc41d7cc6527607449c2ae97eceb5 100644 (file)
@@ -30,8 +30,9 @@ def get_filenode_metadata(filenode):
     else:
         file_format = "CHK"
     metadata['format'] = file_format
-    if filenode.get_size() is not None:
-        metadata['size'] = filenode.get_size()
+    size = filenode.get_size()
+    if size is not None:
+        metadata['size'] = size
     return metadata
 
 class IOpHandleTable(Interface):