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

chore: Util cleanup #124

Merged
merged 3 commits into from
Aug 5, 2021
Merged

chore: Util cleanup #124

merged 3 commits into from
Aug 5, 2021

Conversation

EmperorYP7
Copy link
Member

@EmperorYP7 EmperorYP7 commented Jul 20, 2021

Signed-off-by: Yash Pandey (YP) yash.btech.cs19@iiitranchi.ac.in


Description

This code:

  • Replaces some of the const std::string& parameters to std::string_view to allow direct manipulations of strings.
  • Reserves space/memory for heap-allocated arrays beforehand to use std::vector<T>::push_back() without reallocations.
  • Reserves space for hashmaps as well in a similar fashion.
  • Uses range-based for loops for better code readability.
  • Converts raw type casts to static_cast/dynamic_cast to facilitate long-term debugging.
  • Revises the implementation of casbin::JoinSlice(), casbin::ArrayEquals() and other utlity functions.

Important Note

The revised implementation of casbin::ArrayEquals() is showing ambiguous behavior. This caused many tests to fail, which I commented out in this PR. This shall not propagate to casbin::master, so I am reverting back those changes.

Signed-off-by: Yash Pandey (YP) <yash.btech.cs19@iiitranchi.ac.in>
Signed-off-by: Yash Pandey (YP) <yash.btech.cs19@iiitranchi.ac.in>
Signed-off-by: Yash Pandey (YP) <yash.btech.cs19@iiitranchi.ac.in>
@EmperorYP7 EmperorYP7 marked this pull request as ready for review July 30, 2021 15:48
@EmperorYP7
Copy link
Member Author

The revised implementation of casbin::ArrayEquals() is showing ambiguous behavior. This caused many tests to fail, which I commented out in this PR. This shall not propagate to casbin::master, so I am reverting back those changes.

This issue has been resolved and is ready to be merged

@hsluoyz hsluoyz merged commit e176189 into casbin:master Aug 5, 2021
@github-actions
Copy link

github-actions bot commented Aug 5, 2021

🎉 This PR is included in version 1.31.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants