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 6883f8b commit 65401baCopy full SHA for 65401ba
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