mirror of
https://github.com/emirpasic/gods.git
synced 2026-06-15 16:16:35 +03:00
- split iterators into two type (iterator with index and iterator with key)
This commit is contained in:
@@ -40,7 +40,7 @@ import (
|
||||
|
||||
func assertInterfaceImplementation() {
|
||||
var _ stacks.Stack = (*Stack)(nil)
|
||||
var _ containers.Iterator = (*Iterator)(nil)
|
||||
var _ containers.IteratorWithIndex = (*Iterator)(nil)
|
||||
}
|
||||
|
||||
type Stack struct {
|
||||
@@ -115,7 +115,7 @@ func (iterator *Iterator) Value() interface{} {
|
||||
return value
|
||||
}
|
||||
|
||||
func (iterator *Iterator) Index() interface{} {
|
||||
func (iterator *Iterator) Index() int {
|
||||
return iterator.index
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user