-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Further cleanup #438
Further cleanup #438
Conversation
When you want to pass a `std::string` to `std::string_view`, prefer to do such operation during object initialization via `{}` so you can avoid to use the copy constructor, which can be expensive under certain situations.
I haven't touched `include/robin_hood.h` as I don't know whether it's a third-party header file that could get rewritten at a later time of a possible future release by the author(s) of it.
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.
Looks good 👍🏼
@stefanos82 |
No need to, because If we are dealing with actual objects, such as classes then yes, it would have played a major role to retain our Anyway, long story short, the optimizer was already discarding the |
I hope this PR was not done for any performance gains. That's not what this is about. Putting This is about readability and maintainability. https://stackoverflow.com/questions/22285773/use-const-wherever-possible-in-c/22285981#22285981
and
From here:
Something more legitimate might be IsoCPP:
and another opinion right behind:
https://github.com/cpp-best-practices/cppbestpractices/blob/master/04-Considering_Safety.md:
It is for the developer to make fewer mistakes and having a better time reading the code and understanding it. |
Since you are so pedantic and most probably have years of professional experience, by all means feel free to PR anytime and help this project with your expertise. Cheers 👍 |
Revert the removal of const qualifiers on bool paramteres and slap const on all variables that allow it to avoid accidental mutations and improve code readability
Revert the removal of const qualifiers on bool paramteres and slap const on all variables that allow it to avoid accidental mutations and improve code readability
Revert the removal of const qualifiers on bool paramteres and slap const on all variables that allow it to avoid accidental mutations and improve code readability
No description provided.