MCPcopy Create free account
hub / github.com/Monibuca/engine / InsertBefore

Method InsertBefore

util/list.go:23–28  ·  view source on GitHub ↗
(insert *ListItem[T])

Source from the content-addressed store, hash-verified

21}
22
23func (item *ListItem[T]) InsertBefore(insert *ListItem[T]) {
24 if insert.list != nil {
25 panic("item already in list")
26 }
27 item.Pre.InsertAfter(insert)
28}
29func (item *ListItem[T]) InsertBeforeValue(value T) (result *ListItem[T]) {
30 result = &ListItem[T]{Value: value}
31 item.InsertBefore(result)

Callers 2

InsertBeforeValueMethod · 0.95
UnshiftMethod · 0.80

Calls 1

InsertAfterMethod · 0.80

Tested by

no test coverage detected