diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 1a43877c91e0..e49079de7018 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -189,7 +189,16 @@ function isActionOfType( ): action is { [K in keyof T]: ReportAction; }[number] { - return actionNames.includes(action?.actionName as T[number]); + const actionName = action?.actionName as T[number]; + + // This is purely a performance optimization to limit the 'includes()' calls on Hermes + for (const i of actionNames) { + if (i === actionName) { + return true; + } + } + + return false; } function getOriginalMessage(reportAction: OnyxInputOrEntry>): OriginalMessage | undefined {