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

Fixed issue #88 #89

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Fixed issue #88 #89

merged 5 commits into from
Nov 13, 2024

Conversation

spirosmaggioros
Copy link
Owner

Bug in search method

This was caused by searching till tail but now it's fixed to search until nullptr and eventually checking in the end

Bug in push_front method

Now here, tail must be equal to the new pointer if it doesn't exist.

Bug in erase method

Can't see anything wrong with the function after the changes on search and push_front, i believe everything is good now regarding the 3 bugs you found.

#88 is now ready, issue holder might review as well.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.71%. Comparing base (0969166) to head (7c97ff9).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/classes/list/doubly_linked_list.h 83.33% 0 Missing and 2 partials ⚠️
tests/list/doubly_list.cc 95.55% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
- Coverage   89.73%   89.71%   -0.02%     
==========================================
  Files         142      142              
  Lines        6604     6651      +47     
  Branches      846      849       +3     
==========================================
+ Hits         5926     5967      +41     
- Misses        288      289       +1     
- Partials      390      395       +5     
Files with missing lines Coverage Δ
src/classes/list/doubly_linked_list.h 87.40% <83.33%> (-3.00%) ⬇️
tests/list/doubly_list.cc 98.01% <95.55%> (-1.05%) ⬇️

Copy link
Contributor

@Fr1eran Fr1eran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed and tested all these changes, everything is working fine.

Copy link
Contributor

@Fr1eran Fr1eran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now erase function is working properly. Thanks for noticing and fixing it, but I really think we can remove these code in erase since the rest of the code can handle this situation as well.

if (root->val == key) {
root = root->next;
}

@spirosmaggioros
Copy link
Owner Author

You are right about this.
These lines are removed. Closing the issue and merging this PR.

@spirosmaggioros spirosmaggioros merged commit 050c542 into main Nov 13, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working list
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bugs found in “doubly_linked_list.h” and possible solutions
2 participants