mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Mark the error branch of the TRY() macro as unlikely
This results in a measurable (and free!) 2% improvement in test-js run time.
This commit is contained in:
parent
309d71a66b
commit
8a879e205b
Notes:
sideshowbarker
2024-07-17 20:49:00 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/8a879e205b9 Pull-request: https://github.com/SerenityOS/serenity/pull/11933
1 changed files with 6 additions and 6 deletions
12
AK/Try.h
12
AK/Try.h
|
@ -9,12 +9,12 @@
|
|||
// NOTE: This macro works with any result type that has the expected APIs.
|
||||
// It's designed with AK::Result and AK::Error in mind.
|
||||
|
||||
#define TRY(expression) \
|
||||
({ \
|
||||
auto _temporary_result = (expression); \
|
||||
if (_temporary_result.is_error()) \
|
||||
return _temporary_result.release_error(); \
|
||||
_temporary_result.release_value(); \
|
||||
#define TRY(expression) \
|
||||
({ \
|
||||
auto _temporary_result = (expression); \
|
||||
if (_temporary_result.is_error()) [[unlikely]] \
|
||||
return _temporary_result.release_error(); \
|
||||
_temporary_result.release_value(); \
|
||||
})
|
||||
|
||||
#define MUST(expression) \
|
||||
|
|
Loading…
Reference in a new issue