From: Raymond Hettinger Date: Sun, 2 Sep 2018 20:34:21 +0000 (-0700) Subject: Minor improvement to code clarity (GH-9036) X-Git-Tag: v3.8.0a1~1114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3267144269b873bcb87a9fcafe94b37be1bcfdc;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 8015a95d2aa7..06a969cebacb 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2074,7 +2074,7 @@ vector_norm(Py_ssize_t n, double *vec, double max, int found_nan) if (found_nan) { return Py_NAN; } - if (max == 0.0 || n == 1) { + if (max == 0.0 || n <= 1) { return max; } for (i=0 ; i < n ; i++) {