Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Conversation

@MrOnosa
Copy link
Contributor

@MrOnosa MrOnosa commented Feb 19, 2019

I changed the while to an if because the previous implementation would always return false the second time that condition was checked. The queue is dequeued with each enqueue and all the properties involved are private, so it's safe to assume the condition only needs to be checked once. Note, this is not thread safe, but RateLimiter already is not thread safe (#248).

I changed the `while` to an `if` because the previous implementation would always return `false` the second time that condition was checked. The queue is dequeued with each enqueue and all the properties involved are private, so it's safe to assume the condition only needs to be checked once. Note, this is not thread safe, but RateLimiter already is not thread safe (XeroAPI#248).
@MatthewSteeples
Copy link
Contributor

By the same logic, you can change the >= to just be ==

@MJMortimer
Copy link
Contributor

Thanks for this @MrOnosa, sorry for the delay in merge

@MJMortimer MJMortimer merged commit cae2617 into XeroAPI:master Apr 27, 2020
@MrOnosa MrOnosa deleted the patch-1 branch June 3, 2020 17:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants