Fix interface monitor for android

This commit is contained in:
世界
2023-04-19 21:42:40 +08:00
parent 20e9da5c67
commit b498a22972
10 changed files with 342 additions and 29 deletions
+16
View File
@@ -29,3 +29,19 @@ func (i *iterator[T]) Next() T {
func (i *iterator[T]) HasNext() bool {
return len(i.values) > 0
}
type abstractIterator[T any] interface {
Next() T
HasNext() bool
}
func iteratorToArray[T any](iterator abstractIterator[T]) []T {
if iterator == nil {
return nil
}
var values []T
for iterator.HasNext() {
values = append(values, iterator.Next())
}
return values
}