}
//Get the cost of the next item to dequeue
unsigned get_cost() const {
- return lp.begin()->cost;
+ assert(!empty());
+ return lp.begin()->cost;
}
T pop() {
assert(!lp.empty());
ret.first->insert(cost, item, front);
}
unsigned get_cost() const {
- return next->get_cost();
+ assert(!empty());
+ return next->get_cost();
}
T pop() {
T ret = next->pop();
return count;
}
void dump(ceph::Formatter *f) const {
- f->dump_int("num_keys", next->get_size());
- f->dump_int("first_item_cost", next->get_cost());
+ f->dump_int("num_keys", next->get_size());
+ if (!empty()) {
+ f->dump_int("first_item_cost", next->get_cost());
+ }
}
};
class Queue {