summaryrefslogtreecommitdiff
path: root/doc/progs/sort.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-10-13 13:05:42 -0700
committerRob Pike <r@golang.org>2009-10-13 13:05:42 -0700
commit03a2cf3bbc1bb6a1ee6ffa8cae9081c0fc7b9986 (patch)
treeed73756886be79cd37765b611da3f8e1ec2d80e0 /doc/progs/sort.go
parent00eee8bd56594f7993a150770ebc6ab478db5b76 (diff)
downloadgolang-03a2cf3bbc1bb6a1ee6ffa8cae9081c0fc7b9986.tar.gz
align the tutorial with the renaming of SortInterface.
fix a bug in makehtml - was deleting the output! R=rsc DELTA=11 (2 added, 0 deleted, 9 changed) OCL=35672 CL=35674
Diffstat (limited to 'doc/progs/sort.go')
-rw-r--r--doc/progs/sort.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/progs/sort.go b/doc/progs/sort.go
index 687217a31..5b16ad260 100644
--- a/doc/progs/sort.go
+++ b/doc/progs/sort.go
@@ -4,13 +4,13 @@
package sort
-type SortInterface interface {
+type Interface interface {
Len() int;
Less(i, j int) bool;
Swap(i, j int);
}
-func Sort(data SortInterface) {
+func Sort(data Interface) {
for i := 1; i < data.Len(); i++ {
for j := i; j > 0 && data.Less(j, j-1); j-- {
data.Swap(j, j-1);
@@ -18,7 +18,7 @@ func Sort(data SortInterface) {
}
}
-func IsSorted(data SortInterface) bool {
+func IsSorted(data Interface) bool {
n := data.Len();
for i := n - 1; i > 0; i-- {
if data.Less(i, i - 1) {