aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-09-02 21:19:23 -0700
committerEli Schwartz <eschwartz@archlinux.org>2022-10-03 00:02:20 -0400
commit676e66f8530ac45441c160eb8fe1d84a0703ceb6 (patch)
treec188682df2103d90607dbff43c1227de8d195d14 /mesonbuild
parent8c819ab8059c822fe6b82fd2a579741a88b7d0a5 (diff)
downloadmeson-676e66f8530ac45441c160eb8fe1d84a0703ceb6.zip
meson-676e66f8530ac45441c160eb8fe1d84a0703ceb6.tar.gz
meson-676e66f8530ac45441c160eb8fe1d84a0703ceb6.tar.bz2
pylint: enable consider-using-(min|max)-builtin
There's only one case of each, in the same function, so I've handled both in the same commit.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/mixins/clike.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 0efc3fb..cc78639 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -517,9 +517,7 @@ class CLikeCompiler(Compiler):
low = cur + 1
if low > maxint:
raise mesonlib.EnvironmentException('Cross-compile check overflowed')
- cur = cur * 2 + 1
- if cur > maxint:
- cur = maxint
+ cur = min(cur * 2 + 1, maxint)
high = cur
else:
high = cur = -1
@@ -527,9 +525,7 @@ class CLikeCompiler(Compiler):
high = cur - 1
if high < minint:
raise mesonlib.EnvironmentException('Cross-compile check overflowed')
- cur = cur * 2
- if cur < minint:
- cur = minint
+ cur = max(cur * 2, minint)
low = cur
else:
# Sanity check limits given by user