Skip to content

Commit f326714

Browse files
authored
Minor improvement to code clarity (GH-9036)
Make it clear that the n==0 case is included. Otherwise, you have to know that max==0.0 whenever n==0.
1 parent 98b976a commit f326714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/mathmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ vector_norm(Py_ssize_t n, double *vec, double max, int found_nan)
20742074
if (found_nan) {
20752075
return Py_NAN;
20762076
}
2077-
if (max == 0.0 || n == 1) {
2077+
if (max == 0.0 || n <= 1) {
20782078
return max;
20792079
}
20802080
for (i=0 ; i < n ; i++) {

0 commit comments

Comments
 (0)