func CopyStackByteType(des *Stack, src *Stack) { if src.Size() == 0 { return } for _, v := range src.array { switch element := v.(type) { case []byte: { length := len(element) tmpSlice := make([]byte, length) copy(tmpSlice, element) des.array = append(des.array, tmpSlice)
(other *Stack)
| 153 | //} |
| 154 | |
| 155 | func (s *Stack) Equal(other *Stack) bool { |
| 156 | if s.Size() != other.Size() { |
| 157 | return false |
| 158 | } |
| 159 | for i := 0; i < s.Size(); i++ { |
| 160 | if s.array[i] != other.array[i] { |
| 161 | return false |
| 162 | } |
| 163 | } |
| 164 | return true |
| 165 | } |
| 166 | |
| 167 | //func (s *Stack) Last() interface{} { |
| 168 | // if s.Size() == 0 { |