Use max instead of if-else for numerical checks (as per linter warning)

This commit is contained in:
Roy-043
2024-09-12 14:10:33 +02:00
committed by Yorik van Havre
parent 9ec88feabc
commit d10b1ba96a
2 changed files with 4 additions and 7 deletions

View File

@@ -475,11 +475,9 @@ def placements_on_path(shapeRotation, pathwire, count, xlate, align,
end = endOffset
cdist = cdist - start - end
if count < 1:
count = 1
count = max(count, 1)
n = count if (DraftGeomUtils.isReallyClosed(pathwire) and not (start or end)) else count - 1
if n == 0:
n = 1
n = max(n, 1)
step = cdist / n
remains = 0
travel = start