-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
using IndexSet to store policy in assertion #47
using IndexSet to store policy in assertion #47
Conversation
The disadvantage is that 1st run:
2nd run:
But from an user's prospective, I think it's ok to have different orders. |
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
Coverage ? 85.89%
=========================================
Files ? 12
Lines ? 1992
Branches ? 0
=========================================
Hits ? 1711
Misses ? 281
Partials ? 0
Continue to review full report at Codecov.
|
@hsluoyz How do you think? |
@GopherJ will Golang Casbin keep the order? |
@hsluoyz Yes it will keep the result's order. So I'm not sure how do we handle this in rust, |
@GopherJ can we have the same behavior as Golang Casbin? |
2f21983
to
f91d57f
Compare
lgtm |
Previously we are using
sort_unstable
+dedup
to avoid adding a policy the second time, but the sort operation is expensive, so I made this PR which stores policies inHashSet
, in rust there is no problem to compare two arrays.That'll probably make it more efficient.