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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: Reduced some common duplicate code #275

Conversation

tcoyvwac
Copy link
Contributor

Hi @patriciogonzalezvivo! 馃樃

Noticed some lines-of-code could be reduced a bit. Wanted to help by moving some common code to their own local functions and/or preferring to use some available standard-library algorithms (which performs the same thing).
Also using a simple keyword datatype to hopefully make the code more readable and modular.


Thank you for your very useful project and great project BTW! 馃帀

@tcoyvwac tcoyvwac force-pushed the fix/condense-and-use-std-algorithms-tools branch from d84b32a to 0ac2cda Compare July 21, 2022 22:22
@patriciogonzalezvivo
Copy link
Owner

This is great! thank you!

text.cpp:
* Moved duplicate code into own functions.
* Moved the common functions to anonymous namespace.
* Prefer standard algorithms and standard datatypes.
* Prefer tag-dispatching for specialised regex search queries.
@tcoyvwac tcoyvwac force-pushed the fix/condense-and-use-std-algorithms-tools branch from 4041a39 to d0a5026 Compare July 23, 2022 15:35
text.cpp:
* Converted output pass-by-references to more understandable & context-
friendly-tailored member variables (for a specialised function-object).
@tcoyvwac tcoyvwac force-pushed the fix/condense-and-use-std-algorithms-tools branch from d270120 to d8f0c14 Compare July 24, 2022 09:31
@tcoyvwac
Copy link
Contributor Author

Thanks for your positive feedback & encouragement @patriciogonzalezvivo! 馃帀

The PR is basically finished now. I hope it was understandable!
Do you have any extra requests or recommendations? If no, you can feel free to merge please! 馃樃

@patriciogonzalezvivo
Copy link
Owner

This is fantastic! Thank you so much! Deeply appreciate the time and care you put on it. It's way smarter. Love the reusable structure. I'm learning a lot from it.

@patriciogonzalezvivo patriciogonzalezvivo merged commit b427111 into patriciogonzalezvivo:main Jul 25, 2022
@tcoyvwac
Copy link
Contributor Author

Thanks for the merge & once again encouragement @patriciogonzalezvivo. Grateful! 馃帀

@tcoyvwac tcoyvwac deleted the fix/condense-and-use-std-algorithms-tools branch July 27, 2022 15:47
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.

None yet

2 participants