(element, left, right *ListElement[Key, Value])
| 112 | } |
| 113 | |
| 114 | func (l *List[Key, Value]) insertAt(element, left, right *ListElement[Key, Value]) bool { |
| 115 | if left == nil { |
| 116 | left = l.head |
| 117 | } |
| 118 | |
| 119 | element.next.Store(right) |
| 120 | |
| 121 | if !left.next.CompareAndSwap(right, element) { |
| 122 | return false // item was modified concurrently |
| 123 | } |
| 124 | |
| 125 | l.count.Add(1) |
| 126 | return true |
| 127 | } |
no test coverage detected