Merge remote branch 'quantumelixir/fixes'
This commit is contained in:
commit
e65ed38f87
2 changed files with 2 additions and 3 deletions
3
parse.go
3
parse.go
|
@ -9,7 +9,6 @@ package bencode
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
@ -73,7 +72,7 @@ func collectInt(r Reader, delim byte) (buf []byte, err os.Error) {
|
||||||
err = os.NewError("expected digit")
|
err = os.NewError("expected digit")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
buf = bytes.AddByte(buf, c)
|
buf = append(buf, c)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ func (b *structBuilder) Elem(i int) Builder {
|
||||||
n *= 2
|
n *= 2
|
||||||
}
|
}
|
||||||
nv := reflect.MakeSlice(v.Type().(*reflect.SliceType), v.Len(), n)
|
nv := reflect.MakeSlice(v.Type().(*reflect.SliceType), v.Len(), n)
|
||||||
reflect.ArrayCopy(nv, v)
|
reflect.Copy(nv, v)
|
||||||
v.Set(nv)
|
v.Set(nv)
|
||||||
}
|
}
|
||||||
if v.Len() <= i && i < v.Cap() {
|
if v.Len() <= i && i < v.Cap() {
|
||||||
|
|
Loading…
Reference in a new issue