1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

Change Default Buffer to usize::MAX

This commit is contained in:
electricboogie 2021-04-25 21:38:22 -05:00
parent 1a407c2328
commit e5c19734c8

View file

@ -93,8 +93,7 @@ static NEGATIVE: char = '-';
static POSITIVE: char = '+'; static POSITIVE: char = '+';
static DEFAULT_TMPDIR: &str = r"/tmp"; static DEFAULT_TMPDIR: &str = r"/tmp";
// 4GB buffer for Vec<Line> before we dump to disk, never used static DEFAULT_BUF_SIZE: usize = usize::MAX;
static DEFAULT_BUF_SIZE: usize = 4000000000;
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy)] #[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy)]
enum SortMode { enum SortMode {
@ -142,11 +141,11 @@ impl GlobalSettings {
let suf_usize: usize = match suf_str.to_uppercase().as_str() { let suf_usize: usize = match suf_str.to_uppercase().as_str() {
// SI Units // SI Units
"B" => 1usize, "B" => 1usize,
"K" => 1024usize, "K" => 1000usize,
"M" => 1024000usize, "M" => 1000000usize,
"G" => 1024000000usize, "G" => 1000000000usize,
// GNU regards empty human numeric value as 1024 bytes // GNU regards empty human numeric values as K by default
_ => 1024usize, _ => 1000usize,
}; };
num_usize * suf_usize num_usize * suf_usize
} }