MCPcopy Create free account
hub / github.com/cogentcore/core / SortStable

Method SortStable

tensor/table/indexview.go:241–244  ·  view source on GitHub ↗

Stable sorts -- sometimes essential.. SortStable stably sorts the indexes into our Table using given Less function. The Less function operates directly on row numbers into the Table as these row numbers have already been projected through the indexes. It is *essential* that it always returns false

(lessFunc func(et *Table, i, j int) bool)

Source from the content-addressed store, hash-verified

239// It is *essential* that it always returns false when the two are equal
240// for the stable function to actually work.
241func (ix *IndexView) SortStable(lessFunc func(et *Table, i, j int) bool) {
242 ix.lessFunc = lessFunc
243 sort.Stable(ix)
244}
245
246// SortStableColumnName sorts the indexes into our Table according to values in
247// given column name, using either ascending or descending order.

Callers 3

SortStableColumnMethod · 0.95
SortStableColumnsMethod · 0.95
GroupByFuncFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected