feature: added ToSliceUnsafe method to array list
parent
574f36e64e
commit
b5430036f9
|
@ -193,6 +193,10 @@ func (self *ArrayList[T]) ToSlice() []T {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *ArrayList[T]) ToSliceUnsafe() []T {
|
||||||
|
return self.content[:self.size]
|
||||||
|
}
|
||||||
|
|
||||||
func (self *ArrayList[T]) Find(filter func(T) bool) *optional.Optional[T] {
|
func (self *ArrayList[T]) Find(filter func(T) bool) *optional.Optional[T] {
|
||||||
for index, value := range self.content {
|
for index, value := range self.content {
|
||||||
if index >= self.size {
|
if index >= self.size {
|
||||||
|
|
Loading…
Reference in New Issue