Commit 97efb118 authored by Vincent Pelletier's avatar Vincent Pelletier

Remove meaningless "lazy" evaluation.

self.getObject() is called right at the begining of this methd anyway, so
just keep & reuse it.
parent 517b9c89
...@@ -2197,7 +2197,8 @@ class ListBoxRendererLine: ...@@ -2197,7 +2197,8 @@ class ListBoxRendererLine:
""" """
# If this is a report line without statistics, just return an empty result. # If this is a report line without statistics, just return an empty result.
renderer = self.renderer renderer = self.renderer
if self.getObject() is None: obj = self.getObject()
if obj is None:
return [(None, '')] * len(renderer.getSelectedColumnList()) return [(None, '')] * len(renderer.getSelectedColumnList())
# Otherwise, evaluate each column. # Otherwise, evaluate each column.
...@@ -2250,7 +2251,6 @@ class ListBoxRendererLine: ...@@ -2250,7 +2251,6 @@ class ListBoxRendererLine:
processed_value = original_value processed_value = original_value
else: else:
# This is an usual line. # This is an usual line.
obj = None # Only evaluate if needed
brain = self.getBrain() brain = self.getBrain()
# Use a widget, if any. # Use a widget, if any.
...@@ -2265,7 +2265,6 @@ class ListBoxRendererLine: ...@@ -2265,7 +2265,6 @@ class ListBoxRendererLine:
editable_field.get_tales) editable_field.get_tales)
tales = get_tales('default') tales = get_tales('default')
if tales: if tales:
obj = self.getObject()
original_value = editable_field.__of__(obj).get_value('default', original_value = editable_field.__of__(obj).get_value('default',
cell=brain) cell=brain)
processed_value = original_value processed_value = original_value
...@@ -2276,7 +2275,6 @@ class ListBoxRendererLine: ...@@ -2276,7 +2275,6 @@ class ListBoxRendererLine:
original_value = getattr(brain, alias) original_value = getattr(brain, alias)
processed_value = original_value processed_value = original_value
else: else:
obj = self.getObject()
if obj is not None: if obj is not None:
try: try:
# Get the trailing part. # Get the trailing part.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment