Remove ticket_cost member as it is no longer needed

This commit is contained in:
Nils O. Selåsdal
2013-10-15 22:31:57 +02:00
parent 0a36c669c6
commit 934088ca4a
2 changed files with 19 additions and 14 deletions
+10 -3
View File
@@ -54,15 +54,22 @@ struct RateLimit {
//internal fields:
//how much each ticket is worth.
long ticket_cost;
//money we have to "buy" tickets
long funds;
//time of the previos period
long last_ts;
};
/** Static initializer for a struct RateLimit
*
* @param tickets number of tickets (bucket depth)
* @param period per this period
*/
#define UC_RATELIMIT_INITIALIZER(tickets, period)\
{ tickets, period, tickets * period, 0}
/**
* Initialize a struct RateLimit, which can hand out @tickets per @period
* the perioid must be in the same units as the current_ts