MCPcopy Create free account
hub / github.com/benbjohnson/immutable / Prepend

Method Prepend

immutable_test.go:310–315  ·  view source on GitHub ↗

Prepend adds v to the beginning of the slice and List.

(v int)

Source from the content-addressed store, hash-verified

308
309// Prepend adds v to the beginning of the slice and List.
310func (l *TList) Prepend(v int) {
311 l.prev = l.im
312 l.im = l.im.Prepend(v)
313 l.builder.Prepend(v)
314 l.std = append([]int{v}, l.std...)
315}
316
317// Set updates the value at index i to v in the slice and List.
318func (l *TList) Set(i, v int) {

Callers 5

TestListFunction · 0.95
BenchmarkList_PrependFunction · 0.45
ExampleList_PrependFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected