Skip to content

Commit bf64165

Browse files
committed
clean up redundant early returns in turbopack-core resolve
1 parent 1910e3b commit bf64165

File tree

1 file changed

+0
-15
lines changed
  • turbopack/crates/turbopack-core/src/resolve

1 file changed

+0
-15
lines changed

turbopack/crates/turbopack-core/src/resolve/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,11 +1708,6 @@ async fn handle_before_resolve_plugins(
17081708
) -> Result<Option<Vc<ResolveResult>>> {
17091709
let options_value = options.await?;
17101710

1711-
// Early return if no before_resolve_plugins are configured
1712-
if options_value.before_resolve_plugins.is_empty() {
1713-
return Ok(None);
1714-
}
1715-
17161711
for plugin in &options_value.before_resolve_plugins {
17171712
let condition = plugin.before_resolve_condition().resolve().await?;
17181713
if !*condition.matches(request).await? {
@@ -1740,11 +1735,6 @@ async fn handle_after_resolve_plugins(
17401735
// Pre-fetch options to avoid repeated await calls in the inner loop
17411736
let options_value = options.await?;
17421737

1743-
// Early return if no after_resolve_plugins are configured
1744-
if options_value.after_resolve_plugins.is_empty() {
1745-
return Ok(result);
1746-
}
1747-
17481738
// Pre-resolve all plugin conditions once to avoid repeated resolve calls in the loop
17491739
let mut resolved_conditions: Vec<AfterResolvePluginWithCondition> =
17501740
Vec::with_capacity(options_value.after_resolve_plugins.len());
@@ -2636,11 +2626,6 @@ async fn apply_in_package(
26362626
query: RcStr,
26372627
fragment: RcStr,
26382628
) -> Result<Option<Vc<ResolveResult>>> {
2639-
// Early return if no in_package rules
2640-
if options_value.in_package.is_empty() {
2641-
return Ok(None);
2642-
}
2643-
26442629
// Check alias field for module aliases first
26452630
for in_package in options_value.in_package.iter() {
26462631
// resolve_module_request is called when importing a node

0 commit comments

Comments
 (0)