Skip to content

Commit

Permalink
Remove OutputAssets::new if condition (vercel/turborepo#6195)
Browse files Browse the repository at this point in the history
### Description

It's unneeded, the input param caching will correctly handle this case
already.

vercel/turborepo#6194 (comment)

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes WEB-1794
  • Loading branch information
jridgewell authored Oct 21, 2023
1 parent dc89c5d commit 3bef347
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/turbopack-core/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ pub struct OutputAssets(Vec<Vc<Box<dyn OutputAsset>>>);
impl OutputAssets {
#[turbo_tasks::function]
pub fn new(assets: Vec<Vc<Box<dyn OutputAsset>>>) -> Vc<Self> {
if assets.is_empty() {
OutputAssets::empty()
} else {
Vc::cell(assets)
}
Vc::cell(assets)
}
}

#[turbo_tasks::function]
impl OutputAssets {
pub fn empty() -> Vc<Self> {
Vc::cell(vec![])
Self::new(vec![])
}
}

Expand Down

0 comments on commit 3bef347

Please sign in to comment.