mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-05 12:57:36 +03:00
Fix interface monitor for android
This commit is contained in:
parent
20e9da5c67
commit
b498a22972
10 changed files with 342 additions and 29 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue