github.com/searKing/golang/go@v1.2.74/container/slice/nonematch.go (about) 1 // Copyright 2020 The searKing Author. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package slice 6 7 // NoneMatchFunc returns whether no elements of this stream match the provided predicate. 8 // May not evaluate the predicate on all elements if not necessary for 9 // determining the result. If the stream is empty then {@code true} is 10 // returned and the predicate is not evaluated. 11 func NoneMatchFunc(s interface{}, f func(interface{}) bool) bool { 12 return noneMatchFunc(Of(s), f, true) 13 } 14 15 // noneMatchFunc is the same as NoneMatchFunc. 16 func noneMatchFunc(s []interface{}, f func(interface{}) bool, truth bool) bool { 17 return !anyMatchFunc(s, f, truth) 18 }