gitee.com/lh-her-team/common@v1.5.1/queue/iterator.go (about)

     1  package queue
     2  
     3  type Iterator struct {
     4  	current *node
     5  }
     6  
     7  func (i *Iterator) Value() Element {
     8  	if i.current == nil {
     9  		return nil
    10  	}
    11  	return i.current.value
    12  }
    13  
    14  func (i *Iterator) Next() *Iterator {
    15  	if i.current == nil {
    16  		return nil
    17  	}
    18  	i.current = i.current.next
    19  	return i
    20  }