From 676e66f8530ac45441c160eb8fe1d84a0703ceb6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 2 Sep 2022 21:19:23 -0700 Subject: 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. --- mesonbuild/compilers/mixins/clike.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'mesonbuild/compilers') 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 -- cgit v1.1