Skip to content

Remove duplicated code

Rodrigo Muino Tomonari requested to merge github/fork/jahirfiquitiva/buffer into master
Description

I was checking at the source code of the buffer.js file, and noticed that certain parts of the code could be simplified.

Basically, you were checking for some lowercase expected text and then doing "something". If the text was not lowercase, you would make it lowercase and then do the exact same check and the exact same "something".

So, I thought, why not ensuring the text is already lowercase and then do the checks only once?

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Notes

Unfortunately I didn't read or noticed the Pull Request contribution guidelines before creating it, so I hope there's no issue into getting the changes merged (if they deserve to be merged).

Thanks a ton

Merge request reports

Loading