Skip to content

Commit aae7c64

Browse files
committed
Simplify max_index calculation in tool_setup_shape function
1 parent 2c43cf4 commit aae7c64

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

datalab/gui/roieditor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ def tool_setup_shape(
9696
name = str(item.title().text())
9797
match = re.match(r"ROI(\d+)", name)
9898
if match is not None:
99-
index = int(match.group(1))
100-
if index > max_index:
101-
max_index = index
99+
max_index = max(max_index, int(match.group(1)))
102100
shape.setTitle(f"ROI{max_index + 1:02d}")
103101

104102

0 commit comments

Comments
 (0)