Skip to content

Commit 99b1726

Browse files
committed
perf: avoid duplicate provider policy artifact misses
1 parent 167e433 commit 99b1726

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/plugins/provider-public-artifacts.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,13 @@ export function resolveBundledProviderPolicySurface(
102102
if (!normalizedProviderId) {
103103
return null;
104104
}
105-
return (
106-
tryLoadBundledProviderPolicySurface(normalizedProviderId) ??
107-
tryLoadBundledProviderPolicySurface(
108-
resolveBundledProviderPolicyPluginId(normalizedProviderId, options) ?? normalizedProviderId,
109-
)
110-
);
105+
const directSurface = tryLoadBundledProviderPolicySurface(normalizedProviderId);
106+
if (directSurface) {
107+
return directSurface;
108+
}
109+
const ownerPluginId = resolveBundledProviderPolicyPluginId(normalizedProviderId, options);
110+
if (!ownerPluginId || ownerPluginId === normalizedProviderId) {
111+
return null;
112+
}
113+
return tryLoadBundledProviderPolicySurface(ownerPluginId);
111114
}

0 commit comments

Comments
 (0)