Skip to content

Conversation

@Petersoj
Copy link
Contributor

@Petersoj Petersoj commented Feb 4, 2025

The current HttpStatus.forStatus implementation appears to be a brute force search:

fun forStatus(status: Int): HttpStatus =
HttpStatus.entries.find { it.code == status } ?: UNKNOWN

This PR changes the HttpStatus.forStatus implementation to use a map lookup, similar to HandlerType.findByName.

@codecov
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.13%. Comparing base (2b63b76) to head (f27e462).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2368   +/-   ##
=========================================
  Coverage     87.12%   87.13%           
  Complexity     1320     1320           
=========================================
  Files           148      148           
  Lines          4467     4468    +1     
  Branches        512      512           
=========================================
+ Hits           3892     3893    +1     
  Misses          354      354           
  Partials        221      221           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tipsy
Copy link
Member

tipsy commented Mar 2, 2025

Thanks @Petersoj, and thanks @dzikoysk for reviewing !

@tipsy tipsy merged commit 5d36221 into javalin:master Mar 2, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants