// Filter removes events that do not satisfy a given predicate from the event
// queue.
Filter removes events that do not satisfy a given predicate from the event
queue.
// Filter removes events that do not satisfy a given predicate from the event // queue .
func (eq *EventQueue) Filter(fn func(ev Event) bool) {
	neq := NewEventQueue()
	for !eq.Empty() {
		evr := eq.pop()
		if fn(evr.Event) {
			neq.Push(evr.Event, evr.Rank)
		}
	}
	*eq = *neq
}
func ( eq * EventQueue ) Filter ( fn func ( ev Event ) bool ) { neq := NewEventQueue ( ) for ! eq . Empty ( ) { evr := eq . pop ( ) if fn ( evr . Event ) { neq . Push ( evr . Event , evr . Rank ) } } * eq = * neq }
Filter removes events that do not satisfy a given predicate from the event
queue.
Filter removes events that do not satisfy a given predicate from the event queue .