From 346b5c4c3d1cf5bed7389936dea72b5204b904ea Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Fri, 10 Oct 2014 20:36:08 +0100 Subject: [PATCH] Don't call filenode.get_size() twice. refs #1634 Signed-off-by: Daira Hopwood --- src/allmydata/web/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allmydata/web/common.py b/src/allmydata/web/common.py index 2c873206..af5f6d26 100644 --- a/src/allmydata/web/common.py +++ b/src/allmydata/web/common.py @@ -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): -- 2.45.2