summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/afero/unionFile.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-06-16 21:00:49 +0200
committerGitHub <noreply@github.com>2021-06-16 21:00:49 +0200
commitfb5a84212c491332504fcdd4b5f4a4b97705d2e3 (patch)
treebe03e973d30d040a49a90c47f1e6b73ed8922539 /vendor/github.com/spf13/afero/unionFile.go
parentdedc1c45a113d8db373d9e4638f54a0f9d29624f (diff)
downloadmatterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.tar.gz
matterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.tar.bz2
matterbridge-msglm-fb5a84212c491332504fcdd4b5f4a4b97705d2e3.zip
Update dependencies (#1521)
Diffstat (limited to 'vendor/github.com/spf13/afero/unionFile.go')
-rw-r--r--vendor/github.com/spf13/afero/unionFile.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/vendor/github.com/spf13/afero/unionFile.go b/vendor/github.com/spf13/afero/unionFile.go
index eda96312..985363ee 100644
--- a/vendor/github.com/spf13/afero/unionFile.go
+++ b/vendor/github.com/spf13/afero/unionFile.go
@@ -186,25 +186,22 @@ func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) {
}
f.files = append(f.files, merged...)
}
+ files := f.files[f.off:]
- if c <= 0 && len(f.files) == 0 {
- return f.files, nil
+ if c <= 0 {
+ return files, nil
}
- if f.off >= len(f.files) {
+ if len(files) == 0 {
return nil, io.EOF
}
- if c <= 0 {
- return f.files[f.off:], nil
- }
-
- if c > len(f.files) {
- c = len(f.files)
+ if c > len(files) {
+ c = len(files)
}
defer func() { f.off += c }()
- return f.files[f.off:c], nil
+ return files[:c], nil
}
func (f *UnionFile) Readdirnames(c int) ([]string, error) {