Change-Id: If8dc6d917b55119b5662ce5b0b87328d220d684d
GitHub-Last-Rev:
cc9a1d5a7e2599ee7f98c61d35b2450b9b6a92c3
GitHub-Pull-Request: golang/go#45388
Reviewed-on: https://go-review.googlesource.com/c/go/+/307250
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
func (d *openDir) ReadDir(count int) ([]fs.DirEntry, error) {
n := len(d.files) - d.offset
- if count > 0 && n > count {
- n = count
- }
if n == 0 {
if count <= 0 {
return nil, nil
}
return nil, io.EOF
}
+ if count > 0 && n > count {
+ n = count
+ }
list := make([]fs.DirEntry, n)
for i := range list {
list[i] = &d.files[d.offset+i]
func (d *mapDir) ReadDir(count int) ([]fs.DirEntry, error) {
n := len(d.entry) - d.offset
- if count > 0 && n > count {
- n = count
- }
if n == 0 && count > 0 {
return nil, io.EOF
}
+ if count > 0 && n > count {
+ n = count
+ }
list := make([]fs.DirEntry, n)
for i := range list {
list[i] = &d.entry[d.offset+i]