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.
This commit is contained in:
Dylan Baker 2022-09-02 21:19:23 -07:00 committed by Eli Schwartz
parent 8c819ab805
commit 676e66f853
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
2 changed files with 2 additions and 8 deletions

View File

@ -14,8 +14,6 @@ disable=
cell-var-from-loop, cell-var-from-loop,
consider-merging-isinstance, consider-merging-isinstance,
consider-using-f-string, consider-using-f-string,
consider-using-max-builtin,
consider-using-min-builtin,
consider-using-with, consider-using-with,
cyclic-import, cyclic-import,
deprecated-decorator, deprecated-decorator,

View File

@ -517,9 +517,7 @@ class CLikeCompiler(Compiler):
low = cur + 1 low = cur + 1
if low > maxint: if low > maxint:
raise mesonlib.EnvironmentException('Cross-compile check overflowed') raise mesonlib.EnvironmentException('Cross-compile check overflowed')
cur = cur * 2 + 1 cur = min(cur * 2 + 1, maxint)
if cur > maxint:
cur = maxint
high = cur high = cur
else: else:
high = cur = -1 high = cur = -1
@ -527,9 +525,7 @@ class CLikeCompiler(Compiler):
high = cur - 1 high = cur - 1
if high < minint: if high < minint:
raise mesonlib.EnvironmentException('Cross-compile check overflowed') raise mesonlib.EnvironmentException('Cross-compile check overflowed')
cur = cur * 2 cur = max(cur * 2, minint)
if cur < minint:
cur = minint
low = cur low = cur
else: else:
# Sanity check limits given by user # Sanity check limits given by user