LinusU / LinusU/base32-decode

Optimize by subtracting first.

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.