diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-09-02 21:19:23 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-10-03 00:02:20 -0400 |
commit | 676e66f8530ac45441c160eb8fe1d84a0703ceb6 (patch) | |
tree | c188682df2103d90607dbff43c1227de8d195d14 | |
parent | 8c819ab8059c822fe6b82fd2a579741a88b7d0a5 (diff) | |
download | meson-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.
-rw-r--r-- | .pylintrc | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 8 |
2 files changed, 2 insertions, 8 deletions
@@ -14,8 +14,6 @@ disable= cell-var-from-loop, consider-merging-isinstance, consider-using-f-string, - consider-using-max-builtin, - consider-using-min-builtin, consider-using-with, cyclic-import, deprecated-decorator, 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 |