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

Method Sort

parse/lexer/line.go:85–89  ·  view source on GitHub ↗

Sort sorts the lex elements by starting pos, and ending pos *decreasing* if a tie

()

Source from the content-addressed store, hash-verified

83
84// Sort sorts the lex elements by starting pos, and ending pos *decreasing* if a tie
85func (ll *Line) Sort() {
86 sort.Slice((*ll), func(i, j int) bool {
87 return (*ll)[i].St < (*ll)[j].St || ((*ll)[i].St == (*ll)[j].St && (*ll)[i].Ed > (*ll)[j].Ed)
88 })
89}
90
91// DeleteIndex deletes at given index
92func (ll *Line) DeleteIndex(idx int) {

Callers 14

MakeToolbarMethod · 0.45
TestColorMapsFunction · 0.45
ParseErrReportMethod · 0.45
ParseErrReportAllMethod · 0.45
NamesMethod · 0.45
KindNamesMethod · 0.45
NamesMethod · 0.45
KindNamesMethod · 0.45
ListMethod · 0.45
FilenamesFunction · 0.45
UnmarshalXMLFunction · 0.45

Calls 1

SliceMethod · 0.80

Tested by 2

TestColorMapsFunction · 0.36
compareElementsFunction · 0.36