query capacity before popping (#16828)
* query capacity before popping Signed-off-by: fishbell <bell.song@intel.com> * refine Signed-off-by: fishbell <bell.song@intel.com> --------- Signed-off-by: fishbell <bell.song@intel.com>
This commit is contained in:
@@ -62,7 +62,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
bool try_pop(T& value) {
|
||||
return _pqueue.try_pop(value);
|
||||
return _capacity ? _pqueue.try_pop(value) : false;
|
||||
}
|
||||
void set_capacity(std::size_t newCapacity) {
|
||||
_capacity = newCapacity;
|
||||
|
||||
Reference in New Issue
Block a user