Skip to content

Commit adb3bb1

Browse files
committed
remove some unreachable code. If condition is always the same.
There is a test: if not value: continue then there is code below that at the same level that tests for: if value: and if value is None: Neither of these tests can be anything but the static values of True and False respectively. Simplify code by removing the tests.
1 parent d3deaff commit adb3bb1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

roundup/roundupdb.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,14 +790,10 @@ def generateCreateNote(self, issueid):
790790
continue
791791
if isinstance(prop, hyperdb.Link):
792792
link = self.db.classes[prop.classname]
793-
if value:
794-
key = link.labelprop(default_to_id=1)
795-
if key:
796-
value = link.get(value, key)
797-
else:
798-
value = ''
793+
key = link.labelprop(default_to_id=1)
794+
if key:
795+
value = link.get(value, key)
799796
elif isinstance(prop, hyperdb.Multilink):
800-
if value is None: value = [] # noqa: E701
801797
link = self.db.classes[prop.classname]
802798
key = link.labelprop(default_to_id=1)
803799
if key:

0 commit comments

Comments
 (0)