diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /libgo/go/embed/embed.go | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'libgo/go/embed/embed.go')
-rw-r--r-- | libgo/go/embed/embed.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/embed/embed.go b/libgo/go/embed/embed.go index 98da870..851cc21 100644 --- a/libgo/go/embed/embed.go +++ b/libgo/go/embed/embed.go @@ -143,7 +143,7 @@ import ( // See the package documentation for more details about initializing an FS. type FS struct { // The compiler knows the layout of this struct. - // See cmd/compile/internal/gc's initEmbed. + // See cmd/compile/internal/staticdata's WriteEmbed. // // The files list is sorted by name but not by simple string comparison. // Instead, each file's name takes the form "dir/elem" or "dir/elem/". @@ -213,7 +213,7 @@ var ( // It implements fs.FileInfo and fs.DirEntry. type file struct { // The compiler knows the layout of this struct. - // See cmd/compile/internal/gc's initEmbed. + // See cmd/compile/internal/staticdata's WriteEmbed. name string data string hash [16]byte // truncated SHA256 hash @@ -386,15 +386,15 @@ func (d *openDir) Read([]byte) (int, error) { 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] |