mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
refactor: remove unused code
This commit is contained in:
+1
-2
@@ -424,10 +424,9 @@ func ForEach[T any](slice []T, iteratee func(index int, item T)) {
|
|||||||
// ForEachWithBreak iterates over elements of slice and invokes function for each element,
|
// ForEachWithBreak iterates over elements of slice and invokes function for each element,
|
||||||
// when iteratee return false, will break the for each loop.
|
// when iteratee return false, will break the for each loop.
|
||||||
func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool) {
|
func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool) {
|
||||||
loop:
|
|
||||||
for i, v := range slice {
|
for i, v := range slice {
|
||||||
if !iteratee(i, v) {
|
if !iteratee(i, v) {
|
||||||
break loop
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user