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

Method InsertAfter

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

Source from the content-addressed store, hash-verified

32 return
33}
34func (item *ListItem[T]) InsertAfter(insert *ListItem[T]) {
35 if insert.list != nil {
36 panic("item already in list")
37 }
38 insert.list = item.list
39 insert.Next = item.Next
40 insert.Pre = item
41 item.Next.Pre = insert
42 item.Next = insert
43 item.list.Length++
44}
45
46func (item *ListItem[T]) InsertAfterValue(value T) (result *ListItem[T]) {
47 result = &ListItem[T]{Value: value}

Callers 3

InsertAfterValueMethod · 0.95
InsertBeforeMethod · 0.80
PushMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected