This commit is contained in:
xxjwxc
2020-08-15 01:52:20 +08:00
parent 8804e91312
commit 3653a0aec8
3 changed files with 5 additions and 7 deletions

View File

@@ -5,10 +5,8 @@ type base struct {
items []interface{}
}
func (b *base) Add(args ...interface{}) {
for _, v := range args {
b.items = append(b.items, v)
}
func (b *base) Add(item interface{}) {
b.items = append(b.items, item)
}
// EqualAt 获取相等位置下标,不重复返回-1
@@ -23,7 +21,7 @@ func (b *base) EqualAt(item interface{}) int {
}
// GetItems 获取
func (b *base) GetItems() []interface{} {
func (b *base) GetItems() interface{} {
return b.items
}

View File

@@ -27,5 +27,5 @@ func (f *Fifo) PushGrab(item interface{}) {
// Gets 获取
func (f *Fifo) Gets() []interface{} {
return f.GetItems()
return f.items
}

View File

@@ -27,5 +27,5 @@ func (f *Lifo) PushGrab(item interface{}) {
// Gets 获取
func (f *Lifo) Gets() []interface{} {
return f.GetItems()
return f.items
}