From a23b2c082fe5b169b82bc478bbff5001ac145c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=87=E8=A7=81=E5=90=8C=E5=AD=A6?= <1875694521@qq.com> Date: Tue, 22 Jul 2025 22:29:55 +0800 Subject: [PATCH] perf: delete unnecessary calculations (#54443) --- components/_util/placements.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/_util/placements.ts b/components/_util/placements.ts index a456dc657a..aa095ec973 100644 --- a/components/_util/placements.ts +++ b/components/_util/placements.ts @@ -152,6 +152,12 @@ export default function getPlacements(config: PlacementsConfig) { const placementMap: BuildInPlacements = {}; + // Dynamic offset + const arrowOffset = getArrowOffsetToken({ + contentRadius: borderRadius, + limitVerticalRadius: true, + }); + Object.keys(PlacementAlignMap).forEach((key: PlacementType) => { const template = (arrowPointAtCenter && ArrowCenterPlacementAlignMap[key]) || PlacementAlignMap[key]; @@ -195,12 +201,6 @@ export default function getPlacements(config: PlacementsConfig) { break; } - // Dynamic offset - const arrowOffset = getArrowOffsetToken({ - contentRadius: borderRadius, - limitVerticalRadius: true, - }); - if (arrowPointAtCenter) { switch (key) { case 'topLeft':