fastify / fastify-rate-limit

A low overhead rate limiter for your routes
MIT License
505 stars 72 forks source link

remove elseif from the lua script #334

Closed gurgunday closed 1 year ago

gurgunday commented 1 year ago

We are returning in each case so we don't need the elseif

Can't believe I realized this after it got merged

Eomm commented 1 year ago

Does it mean we don't have a test for it? 😏

gurgunday commented 1 year ago

Haha no no, we do have tests, this change didn't alter Redis's behavior

There are return statements inside the conditional checks, eliminating the need for an else if clause; a return statement would already exit the control flow

So it's just a minor personal preference refactor