Skip to content

Commit

Permalink
pkg/netutil: not introduce empty url when converting
Browse files Browse the repository at this point in the history
It should not make slices with length and append elements at the same
time.
  • Loading branch information
yichengq committed Aug 21, 2015
1 parent c530acf commit 0592337
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/netutil/netutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ func URLStringsEqual(a []string, b []string) bool {
if len(a) != len(b) {
return false
}
urlsA := make([]url.URL, len(a))
urlsA := make([]url.URL, 0)
for _, str := range a {
u, err := url.Parse(str)
if err != nil {
return false
}
urlsA = append(urlsA, *u)
}
urlsB := make([]url.URL, len(b))
urlsB := make([]url.URL, 0)
for _, str := range b {
u, err := url.Parse(str)
if err != nil {
Expand Down

0 comments on commit 0592337

Please sign in to comment.