Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //pq_ - std::priority_queue with shared painters on file chunks ( ck ) that automatically loads next data part when current is read.
- for(auto ck : chunks)
- pq_.push(ck);
- size_t buffer_size = 4 * 1024;
- std::vector<int> buffer;
- buffer.reserve(buffer_size);
- while(!pq_.empty())
- {
- auto ck = pq_.top();
- pq_.pop();
- int min = ck->cur();
- if(ck->ok())
- {
- ck->next();
- pq_.push(ck);
- }
- buffer.push_back(min);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement