Skip to content

event predicates logic optimization #1013

@cuisongliu

Description

@cuisongliu

for _, p := range e.Predicates {

this code design is “and” logic。 but I think "or" logic is better?

       var flag bool
       for _, p := range e.Predicates {
		if p.Create(c) {
			flag = true
                        break
		} 
	}
       
        if flag{
             // Invoke create handler
	     e.EventHandler.Create(c, e.Queue)
        }
  • all false result is false;
  • has one true result is true

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions