fastify / fastify-rate-limit

A low overhead rate limiter for your routes
MIT License
477 stars 66 forks source link

remove elseif from the lua script #334

Closed gurgunday closed 10 months ago

gurgunday commented 10 months 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 10 months ago

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

gurgunday commented 10 months 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