From 15734f5c4b96b5f37ec0e7904987ba593f41917e Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Thu, 30 May 2024 01:11:00 +0100 Subject: [PATCH] chore(parser): code comment for cold trampoline function (#3467) Add a comment to explain the "cold trampoline function" used in lexer. --- crates/oxc_parser/src/lexer/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/oxc_parser/src/lexer/mod.rs b/crates/oxc_parser/src/lexer/mod.rs index ee493c45b..830200264 100644 --- a/crates/oxc_parser/src/lexer/mod.rs +++ b/crates/oxc_parser/src/lexer/mod.rs @@ -308,6 +308,8 @@ impl<'a> Lexer<'a> { } /// Call a closure while hinting to compiler that this branch is rarely taken. +/// "Cold trampoline function", suggested in: +/// #[cold] pub fn cold_branch T, T>(f: F) -> T { f()