diff options
Diffstat (limited to 'src/sort/example_multi_test.go')
| -rw-r--r-- | src/sort/example_multi_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sort/example_multi_test.go b/src/sort/example_multi_test.go index 40d12152ce..de6ec142d1 100644 --- a/src/sort/example_multi_test.go +++ b/src/sort/example_multi_test.go @@ -49,10 +49,11 @@ func (ms *multiSorter) Swap(i, j int) { } // Less is part of sort.Interface. It is implemented by looping along the -// less functions until it finds a comparison that is either Less or -// !Less. Note that it can call the less functions twice per call. We -// could change the functions to return -1, 0, 1 and reduce the -// number of calls for greater efficiency: an exercise for the reader. +// less functions until it finds a comparison that discriminates between +// the two items (one is less than the other). Note that it can call the +// less functions twice per call. We could change the functions to return +// -1, 0, 1 and reduce the number of calls for greater efficiency: an +// exercise for the reader. func (ms *multiSorter) Less(i, j int) bool { p, q := &ms.changes[i], &ms.changes[j] // Try all but the last comparison. |
