0x4a52466c696e74 il y a 1 an
Parent
commit
23b664717b
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      containers/concurrent/list.go

+ 8 - 0
containers/concurrent/list.go

@@ -228,3 +228,11 @@ func (s *List) Search(val interface{}) *Element {
 	}
 	return nil
 }
+
+func (s *List) Each(call func(any) bool) {
+	for f := s.First(); f != nil; f = f.Next() {
+		if !call(f.Val()) {
+			return
+		}
+	}
+}