Skip to content

Commit

Permalink
Merge pull request #1553 from bradengroom/short-circuit
Browse files Browse the repository at this point in the history
Order onr comparisons by cardinality for short-circuiting
  • Loading branch information
josephschorr authored Oct 1, 2023
2 parents 846f79e + 615a916 commit e97bbf7
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 e97bbf7

Please sign in to comment.