MCPcopy Create free account
hub / github.com/expr-lang/expr / Swap

Method Swap

internal/spew/common.go:285–290  ·  view source on GitHub ↗

Swap swaps the values at the passed indices. It is part of the sort.Interface implementation.

(i, j int)

Source from the content-addressed store, hash-verified

283// Swap swaps the values at the passed indices. It is part of the
284// sort.Interface implementation.
285func (s *valuesSorter) Swap(i, j int) {
286 s.values[i], s.values[j] = s.values[j], s.values[i]
287 if s.strings != nil {
288 s.strings[i], s.strings[j] = s.strings[j], s.strings[i]
289 }
290}
291
292// valueSortLess returns whether the first value should sort before the second
293// value. It is used by valueSorter.Less as part of the sort.Interface

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected