Skip to content

Commit

Permalink
style(xrpc-server): avoid un-neccessary "if" statement (#1826)
Browse files Browse the repository at this point in the history
fix(xrpc-server): avoid un-neccessary "if" statement
  • Loading branch information
matthieusieben authored Nov 30, 2023
1 parent 2fc6ca5 commit 2513bd1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/xrpc-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ export class Server {
}

// handle rate limits
if (consumeRateLimit) {
const result = await consumeRateLimit(reqCtx)
if (result instanceof RateLimitExceededError) {
return next(result)
}
const result = await consumeRateLimit(reqCtx)
if (result instanceof RateLimitExceededError) {
return next(result)
}

// run the handler
Expand Down

0 comments on commit 2513bd1

Please sign in to comment.