]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: remove dead code
authorRobert Griesemer <gri@golang.org>
Thu, 23 Feb 2012 07:38:18 +0000 (23:38 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 23 Feb 2012 07:38:18 +0000 (23:38 -0800)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5698044

src/cmd/godoc/dirtrees.go

index 90f2c80ce70b1808118d25a30b867608946bed99..b395f6014beaaac822f44087cb48e9b239068cc4 100644 (file)
@@ -15,7 +15,6 @@ import (
        "os"
        "path/filepath"
        "strings"
-       "unicode"
 )
 
 type Directory struct {
@@ -44,41 +43,6 @@ func isPkgDir(fi os.FileInfo) bool {
                name[0] != '_' && name[0] != '.' // ignore _files and .files
 }
 
-func firstSentence(s string) string {
-       i := -1 // index+1 of first terminator (punctuation ending a sentence)
-       j := -1 // index+1 of first terminator followed by white space
-       prev := 'A'
-       for k, ch := range s {
-               k1 := k + 1
-               if ch == '.' || ch == '!' || ch == '?' {
-                       if i < 0 {
-                               i = k1 // first terminator
-                       }
-                       if k1 < len(s) && s[k1] <= ' ' {
-                               if j < 0 {
-                                       j = k1 // first terminator followed by white space
-                               }
-                               if !unicode.IsUpper(prev) {
-                                       j = k1
-                                       break
-                               }
-                       }
-               }
-               prev = ch
-       }
-
-       if j < 0 {
-               // use the next best terminator
-               j = i
-               if j < 0 {
-                       // no terminator at all, use the entire string
-                       j = len(s)
-               }
-       }
-
-       return s[0:j]
-}
-
 type treeBuilder struct {
        pathFilter func(string) bool
        maxDepth   int