-
Notifications
You must be signed in to change notification settings - Fork 184
Small refactor and a bit clean up #535
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
Conversation
|
Thank you @khezam for your contribution ❤️ I might agree in principle on the This PR also lacks testing, but don't worry about cc @snatchblock, what do you think of these changes? |
|
My pleasure @ecoologic :) I see your concerns about unexpected changes for all existing clients and the lack of testing. I was/am expecting the existing tests would catch any unexpected behaviors since this PR only cleans up the current logic of I'm happy to add a test coverage if needed. Let me know :) |
|
Hey @ecoologic, any update on this PR? |
snatchblock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Khezam,
Thank you for the cleanup. Can you add test cases for the code to ensure these changes does not impact the library behaviour? Specifically if objects that before didn’t match with equality might start matching.
Thank you. We will merge this once the test cases and validation is done.
|
Hi @snatchblock, I definitely can add test cases, but this PR does not need test cases because it does not add/remove from the existing logic, it's only rearranging the existing logic. The test cases already exist here, and if I add test cases, they'll be exactly the same. The two methods below are exactly the same but the only difference is that the top one is easy to read. Let me know if I'm missing anything and I'm happy to add test cases accordingly. |
The logic of
==(other)method was a bit confusing so I tried to clean it up to make it easy to read. I also movednew_from_responseclass method ofDataintoclass << selffor consistency.Let me know if there is anything I can change and make it better.