Skip to content

Commit 35695b7

Browse files
committed
explain why I wrote that
1 parent 995fe6e commit 35695b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fieldpath/element.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ type PathElementSet struct {
145145

146146
type sortedPathElements []PathElement
147147

148+
// Implement the sort interface; this would permit bulk creation, which would
149+
// be faster than doing it one at a time via Insert.
148150
func (spe sortedPathElements) Len() int { return len(spe) }
149151
func (spe sortedPathElements) Less(i, j int) bool { return spe[i].Less(spe[j]) }
150152
func (spe sortedPathElements) Swap(i, j int) { spe[i], spe[j] = spe[j], spe[i] }

0 commit comments

Comments
 (0)