-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
df: treat env var with zero block size same as invalid #8932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
df: treat env var with zero block size same as invalid #8932
Conversation
36ce0e3
to
9368339
Compare
CodSpeed Performance ReportMerging #8932 will improve performances by 2.65%Comparing Summary
Benchmarks breakdown
Footnotes
|
GNU testsuite comparison:
|
9368339
to
a9ec6a7
Compare
GNU testsuite comparison:
|
if v != 0 { | ||
Ok(v) | ||
} else { | ||
Err(ParseSizeError::ParseFailure("0".to_string())) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A detail: I would use ==
instead of !=
, it's slightly easier to read. Something like:
if v != 0 { | |
Ok(v) | |
} else { | |
Err(ParseSizeError::ParseFailure("0".to_string())) | |
} | |
if v == 0 { | |
return Err(ParseSizeError::ParseFailure("0"< 8000 span class="pl-kos">.to_string())); | |
} | |
Ok(v) |
a9ec6a7
to
6015c8f
Compare
GNU testsuite comparison:
|
Thanks! |
Fixes #8918.
GNU
df
seems to treat passing0
using an env var the same way as passing an invalid value, by using the default block size instead. SoDF_BLOCK_SIZE=0
andDF_BLOCK_SIZE=invalid
are functionally equivalent (including the cases involving the hierarchy of env vars).