Commit ff8e4582 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

os: avoid a string concat in readdir

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/37690045
parent 6a1a2170
......@@ -160,11 +160,10 @@ func (f *File) readdir(n int) (fi []FileInfo, err error) {
if dirname == "" {
dirname = "."
}
dirname += "/"
names, err := f.Readdirnames(n)
fi = make([]FileInfo, 0, len(names))
for _, filename := range names {
fip, lerr := lstat(dirname + filename)
fip, lerr := lstat(dirname + "/" + filename)
if IsNotExist(lerr) {
// File disappeared between readdir + stat.
// Just treat it as if it didn't exist.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment