mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
core: adjust System.Iterator.Create interop
Closes #1201. It should be able to iterate over primitive byte-array-like types also.
This commit is contained in:
parent
459ac34839
commit
c9ef7425ac
2 changed files with 13 additions and 5 deletions
|
@ -11,10 +11,11 @@ import "github.com/nspcc-dev/neo-go/pkg/interop/enumerator"
|
|||
// structure is similar in function to Neo .net framework's Iterator.
|
||||
type Iterator struct{}
|
||||
|
||||
// Create creates an iterator from the given items (array, struct or map). A new
|
||||
// iterator is set to point at element -1, so to access its first element you
|
||||
// need to call Next first. This function uses `System.Iterator.Create` syscall.
|
||||
func Create(items []interface{}) Iterator {
|
||||
// Create creates an iterator from the given items (array, struct, map, byte
|
||||
// array or integer and boolean converted to byte array). A new iterator is set
|
||||
// to point at element -1, so to access its first element you need to call Next
|
||||
// first. This function uses `System.Iterator.Create` syscall.
|
||||
func Create(items interface{}) Iterator {
|
||||
return Iterator{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue