This commit is contained in:
Lunny Xiao 2019-10-24 17:10:34 +08:00
parent 5a040502f8
commit 6ff3fb9289
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 4 additions and 4 deletions

View File

@ -87,14 +87,14 @@ func (session *Session) bufferIterate(bean interface{}, fun IterFunc) error {
idx++ idx++
} }
if slice.Elem().Len() == 0 || idx == limit {
break
}
start = start + slice.Elem().Len() start = start + slice.Elem().Len()
if limit > 0 && idx+bufferSize > limit { if limit > 0 && idx+bufferSize > limit {
bufferSize = limit - idx bufferSize = limit - idx
} }
if bufferSize <= 0 || slice.Elem().Len() < bufferSize || idx == limit {
break
}
} }
return nil return nil