File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ struct VolumedFile : public std::vector<Volume> {
7474 }
7575 VolumedFile (const std::string& file_name, uint64_t letter_count = 0 ) :
7676 list_file_ (file_name),
77- records_ (0 ),
77+ records_ (std::numeric_limits<OId>::max() ),
7878 max_oid_ (0 ),
7979 letter_count_ (letter_count)
8080 {
@@ -93,11 +93,21 @@ struct VolumedFile : public std::vector<Volume> {
9393 }
9494 push_back (v);
9595 oid += v.record_count ;
96- records_ += v.record_count ;
96+ if (v.record_count == std::numeric_limits<OId>::max ()) {
97+ if (records_ != std::numeric_limits<OId>::max ())
98+ throw std::runtime_error (" Inconsistent record count" );
99+ }
100+ else {
101+ if (records_ == std::numeric_limits<OId>::max ())
102+ records_ = 0 ;
103+ records_ += v.record_count ;
104+ }
97105 if (v.oid_end > 0 )
98106 max_oid_ = std::max (max_oid_, v.oid_end - 1 );
99107 }
100108 std::sort (begin (), end ());
109+ if (empty ())
110+ records_ = 0 ;
101111 }
102112 OId sparse_records () const {
103113 if (records_ == 0 )
You can’t perform that action at this time.
0 commit comments