We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Seekable(Array|File)InputStream::Skip
1 parent 56063c2 commit a85515eCopy full SHA for a85515e
c++/src/io/InputStream.cc
@@ -102,7 +102,7 @@ namespace orc {
102
bool SeekableArrayInputStream::Skip(int count) {
103
if (count >= 0) {
104
uint64_t unsignedCount = static_cast<uint64_t>(count);
105
- if (unsignedCount + position <= length) {
+ if (unsignedCount <= length - position) {
106
position += unsignedCount;
107
return true;
108
} else {
@@ -186,7 +186,11 @@ namespace orc {
186
return false;
187
}
188
uint64_t count = static_cast<uint64_t>(signedCount);
189
- position = std::min(position + count, length);
+ if (count > length - position) {
190
+ position = length;
191
+ } else {
192
+ position += count;
193
+ }
194
pushBack = 0;
195
return position < length;
196
0 commit comments