]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Simplify vector_norm() by eliminating special cases in the main loop (GH-9006)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Fri, 31 Aug 2018 18:22:13 +0000 (11:22 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Aug 2018 18:22:13 +0000 (11:22 -0700)
commit745c0f3980c56e88db6a57311fb20ea11005565b
tree3e30526475411529eecd9a32fbfb78e4d9140714
parentaada63b20ec64bbfc4f2fb0718fc563eedbdd36a
Simplify vector_norm() by eliminating special cases in the main loop (GH-9006)

The *max* value is no longer treated as a special case in the main loop.  Besides making the main loop simpler and branchless, this also lets us relax the input restriction of *vec* to contain only non-negative values.
Modules/mathmodule.c