diff options
author | Russ Cox <rsc@golang.org> | 2010-02-25 16:01:29 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-02-25 16:01:29 -0800 |
commit | 8cdf7be25e63d466a699950effee449803c15da9 (patch) | |
tree | a0a5f67e4a643d3bdadd4e28cee9b0900401b62d /test/bench | |
parent | 4b1a1ade492d1c6450e37ffb44a8dde0c84b377b (diff) | |
download | go-8cdf7be25e63d466a699950effee449803c15da9.tar.gz |
strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports
R=r
CC=golang-dev
http://codereview.appspot.com/224062
Diffstat (limited to 'test/bench')
-rw-r--r-- | test/bench/chameneosredux.go | 2 | ||||
-rw-r--r-- | test/bench/fasta.go | 3 | ||||
-rw-r--r-- | test/bench/k-nucleotide.go | 3 | ||||
-rw-r--r-- | test/bench/meteor-contest.go | 2 | ||||
-rw-r--r-- | test/bench/regex-dna.go | 3 |
5 files changed, 5 insertions, 8 deletions
diff --git a/test/bench/chameneosredux.go b/test/bench/chameneosredux.go index 5445c4210..2cb144004 100644 --- a/test/bench/chameneosredux.go +++ b/test/bench/chameneosredux.go @@ -123,7 +123,7 @@ func pallmall(cols []int) { fmt.Println(msg) tot := 0 // wait for all results - for _ = range (cols) { + for _ = range cols { result := <-ended tot += result.met fmt.Printf("%v%v\n", result.met, spell(result.same, true)) diff --git a/test/bench/fasta.go b/test/bench/fasta.go index 1afb1ffb8..f79ff680f 100644 --- a/test/bench/fasta.go +++ b/test/bench/fasta.go @@ -41,7 +41,6 @@ import ( "bufio" "flag" "os" - "strings" ) var out *bufio.Writer @@ -161,7 +160,7 @@ func main() { AccumulateProbabilities(iub) AccumulateProbabilities(homosapiens) - alu := strings.Bytes( + alu := []byte( "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" + "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA" + "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT" + diff --git a/test/bench/k-nucleotide.go b/test/bench/k-nucleotide.go index a5c7f79bb..b4d4098d0 100644 --- a/test/bench/k-nucleotide.go +++ b/test/bench/k-nucleotide.go @@ -42,7 +42,6 @@ import ( "io/ioutil" "os" "sort" - "strings" ) var in *bufio.Reader @@ -111,7 +110,7 @@ func print(m map[string]int) { func main() { in = bufio.NewReader(os.Stdin) - three := strings.Bytes(">THREE ") + three := []byte(">THREE ") for { line, err := in.ReadSlice('\n') if err != nil { diff --git a/test/bench/meteor-contest.go b/test/bench/meteor-contest.go index 163aaa7c4..6660810eb 100644 --- a/test/bench/meteor-contest.go +++ b/test/bench/meteor-contest.go @@ -532,7 +532,7 @@ func calc_rows() { /* Calculate islands while solving the board. -*/ + */ func boardHasIslands(cell int8) int8 { /* Too low on board, don't bother checking */ if cell >= 40 { diff --git a/test/bench/regex-dna.go b/test/bench/regex-dna.go index 9d56830b3..22de2c6aa 100644 --- a/test/bench/regex-dna.go +++ b/test/bench/regex-dna.go @@ -40,7 +40,6 @@ import ( "io/ioutil" "os" "regexp" - "strings" ) var variants = []string{ @@ -101,7 +100,7 @@ func main() { fmt.Printf("%s %d\n", s, countMatches(s, bytes)) } for _, sub := range substs { - bytes = regexp.MustCompile(sub.pat).ReplaceAll(bytes, strings.Bytes(sub.repl)) + bytes = regexp.MustCompile(sub.pat).ReplaceAll(bytes, []byte(sub.repl)) } fmt.Printf("\n%d\n%d\n%d\n", ilen, clen, len(bytes)) } |