Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
syyongx committed Apr 30, 2019
1 parent 7fb8f38 commit f7e794d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# php2go

[![GoDoc](https://godoc.org/github.com/syyongx/php2go?status.svg)](https://godoc.org/github.com/syyongx/php2go)
[![Go Report Card](https://goreportcard.com/badge/github.com/syyongx/php2go)](https://goreportcard.com/report/github.com/syyongx/php2go)
[![MIT licensed][3]][4]

[3]: https://img.shields.io/badge/license-MIT-blue.svg
Expand Down
6 changes: 3 additions & 3 deletions php.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ func Wordwrap(str string, width uint, br string) string {
if br == "" {
br = "\n"
}
init := make([]byte, 0, len(str))
buf := bytes.NewBuffer(init)

buf := bytes.NewBuffer(make([]byte, 0, len(str)))
var current uint
var wordbuf, spacebuf bytes.Buffer
for _, char := range str {
Expand Down Expand Up @@ -824,7 +824,7 @@ func Levenshtein(str1, str2 string, costIns, costRep, costDel int) int {
return -1
}

tmp := make([]int, l2+1)
var tmp []int
p1 := make([]int, l2+1)
p2 := make([]int, l2+1)
var c0, c1, c2 int
Expand Down

0 comments on commit f7e794d

Please sign in to comment.