Optimize by subtracting first.
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/LinusU/base32-decode/blob/fa61c01bc0bbd963a1abcf86cc519f09d70b09e0/index.js#L49-L50
Switch the places of the two lines of code. Subtract `8` from the `bits` first, so that you don’t have to subtract it again.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open index.js at lines 49-50 from the linked commit and compare the two adjacent statements. Switch their order so bits is reduced by 8 before the other subtraction, then verify that the decoder still behaves correctly and that the repeated subtraction is removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100