Skip to content
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

helper::BytesFactor / parsing #1296

Open
germasch opened this issue Mar 16, 2019 · 0 comments
Open

helper::BytesFactor / parsing #1296

germasch opened this issue Mar 16, 2019 · 0 comments
Assignees
Labels
enhancement triage: low This issue is a nice-to-have if we can get to it but isn't holding anybody up.

Comments

@germasch
Copy link
Contributor

The code that takes the string for initial / max buffer size and parses it to a number doesn't handle bytes. It's also replicated 4 times across BP3/BP4, so since there is already a helper, why not consolidate the entire thing, and do it right?.

BytesFactor understands the suffixes "kb", "mb", "gb", and "b"/"bytes". However the parsing code that calls it assumes that the suffix is exactly two characters always, so "b"/"bytes" will never be understood.

There is helper::EndsWith -- this sounds like a good use for it. It supports case-insensitive match, which would make it understand "GB" etc as well. Finally, why not support a plain number, too? That's what tripped me up originally, I though just saying "1024" should work.

By the way, this is clearly a low priority item.

@williamfgc williamfgc self-assigned this Mar 16, 2019
@williamfgc williamfgc added enhancement triage: low This issue is a nice-to-have if we can get to it but isn't holding anybody up. labels Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement triage: low This issue is a nice-to-have if we can get to it but isn't holding anybody up.
Projects
None yet
Development

No branches or pull requests

2 participants