diff --git a/listhead.go b/listhead.go index d192eb8..3a6b975 100644 --- a/listhead.go +++ b/listhead.go @@ -74,6 +74,16 @@ func (this *ListHead) Next() *ListHead { return this.next } +func (this *ListHead) Size() int32 { + num := int32(0) + this.ForEach_r( + func (data interface{}) bool { + num++ + return true + }) + return num +} + func (this *ListHead) ForEachFrom(from *ListHead, cb ListHead_Foreach_Func) { for pos := from; pos != this; pos = pos.next {