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

Fix infinite loop on single match #39

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Fix infinite loop on single match #39

merged 1 commit into from
Sep 8, 2021

Conversation

abhinav
Copy link
Owner

@abhinav abhinav commented Sep 8, 2021

If there's a single entry in the collection of matches, our huffman
implementation will return an empty label. That results in an infinite
loop when rendering because we attempt to match empy input to an empty
label.

Resolve this by handling the single match case separately.

Fixes #38

If there's a single entry in the collection of matches, our huffman
implementation will return an empty label. That results in an infinite
loop when rendering because we attempt to match empy input to an empty
label.

Resolve this by handling the single match case separately.

Fixes #38
@codecov-commenter
Copy link

Codecov Report

Merging #39 (88db35f) into main (3561e26) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   73.70%   73.77%   +0.06%     
==========================================
  Files          29       29              
  Lines        1563     1567       +4     
==========================================
+ Hits         1152     1156       +4     
  Misses        390      390              
  Partials       21       21              
Impacted Files Coverage Δ
internal/huffman/huffman.go 97.01% <100.00%> (+0.18%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3561e26...88db35f. Read the comment docs.

@abhinav abhinav merged commit a2ef97a into main Sep 8, 2021
@abhinav abhinav deleted the single-match branch September 8, 2021 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

high cpu usage
2 participants