We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e3f41b commit d119134Copy full SHA for d119134
queue/queue.go
@@ -145,6 +145,25 @@ func (items *items) getUntil(checker func(item interface{}) bool) []interface{}
145
return returnItems
146
}
147
148
+func (items *items) getMatch(checker func(item interface{}) bool) []interface{} {
149
+ length := len(*items)
150
+
151
+ if len(*items) == 0 {
152
+ // returning nil here actually wraps that nil in a list
153
+ // of interfaces... thanks go
154
+ return []interface{}{}
155
+ }
156
157
+ returnItems := make([]interface{}, 0, length)
158
+ for _, item := range *items {
159
+ if !checker(item) {
160
+ returnItems = append(returnItems, item)
161
162
163
164
+ return returnItems
165
+}
166
167
type sema struct {
168
ready chan bool
169
response *sync.WaitGroup
0 commit comments