Skip to content

Commit bdc54bc

Browse files
committed
Python: Replace 'if p() then q() else none()' with a conjunction.
1 parent 8878498 commit bdc54bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/ql/src/Functions/SignatureSpecialMethods.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ predicate incorrect_special_method_defn(
132132
else
133133
if required < func.minParameters()
134134
then message = "Too many parameters" and show_counts = true
135-
else
136-
if func.minParameters() < required and not func.getScope().hasVarArg()
137-
then
138-
message = (required - func.minParameters()) + " default values(s) will never be used" and
139-
show_counts = false
140-
else none()
135+
else (
136+
func.minParameters() < required and
137+
not func.getScope().hasVarArg() and
138+
message = (required - func.minParameters()) + " default values(s) will never be used" and
139+
show_counts = false
140+
)
141141
)
142142
}
143143

0 commit comments

Comments
 (0)