MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / At

Method At

util/atomic/slice.go:51–59  ·  view source on GitHub ↗

At returns the element at the specified index, while checking that the index is in bounds

(index uintptr)

Source from the content-addressed store, hash-verified

49
50// At returns the element at the specified index, while checking that the index is in bounds
51func (a *Slice) At(index uintptr) unsafe.Pointer {
52 if a.Cap() < index {
53 panic("out of bounds")
54 }
55 if a.Len() < index {
56 atomic.StoreUintptr(&a.len, index+1)
57 }
58 return a.Element(index)
59}
60
61// Element returns the element at the specified index, without checking that the index is in bounds
62func (a *Slice) Element(index uintptr) unsafe.Pointer {

Callers

nothing calls this directly

Calls 3

CapMethod · 0.95
LenMethod · 0.95
ElementMethod · 0.95

Tested by

no test coverage detected