Skip to content

Commit

Permalink
fair_queue: Do not re-evaluate request capacity twice
Browse files Browse the repository at this point in the history
On dispatch the request capacity is calculated into req_cap variable, so
it can be reused everywhere below

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul authored and avikivity committed Aug 8, 2023
1 parent 37b1543 commit e077eaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/fair_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ void fair_queue::dispatch_requests(std::function<void(fair_queue_entry&)> cb) {
}
h._accumulated += req_cost;
h._pure_accumulated += req_cap;
dispatched += req_cap;

dispatched += _group.ticket_capacity(req._ticket);
cb(req);

if (h._plugged && !h._queue.empty()) {
Expand Down

0 comments on commit e077eaa

Please sign in to comment.