Fix handling of negative offset.

GitOrigin-RevId: ba5a9bbbb5c7cbad6dbe363b84a499b03fe522ea
This commit is contained in:
levlam 2018-12-27 03:59:17 +03:00
parent 21fa752019
commit 7ae4b6f220

View File

@ -30,6 +30,9 @@ std::string Bitmask::encode() const {
}
int64 Bitmask::get_ready_prefix_size(int64 offset, int64 part_size, int64 file_size) const {
if (offset < 0) {
return 0;
}
auto offset_part = offset / part_size;
auto ones = get_ready_parts(offset_part);
if (ones == 0) {