Skip to content

Commit

Permalink
Order onr comparisons by cardinality for short-circuiting
Browse files Browse the repository at this point in the history
  • Loading branch information
bradengroom committed Sep 30, 2023
1 parent 846f79e commit 615a916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/graph/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func onrEqual(lhs, rhs *core.ObjectAndRelation) bool {
}

func onrEqualOrWildcard(tpl, target *core.ObjectAndRelation) bool {
return onrEqual(tpl, target) || (tpl.Namespace == target.Namespace && tpl.ObjectId == tuple.PublicWildcard)
return onrEqual(tpl, target) || (tpl.ObjectId == tuple.PublicWildcard && tpl.Namespace == target.Namespace)
}

type directDispatch struct {
Expand Down

0 comments on commit 615a916

Please sign in to comment.