Skip to content

Commit

Permalink
chore: improve local variable url is redundant (#5769)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudongyuer authored Nov 20, 2021
1 parent d383112 commit 4a6cf35
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,11 @@ export async function processSrcSet(
})
)

const url = ret.reduce((prev, { url, descriptor }, index) => {
return ret.reduce((prev, { url, descriptor }, index) => {
descriptor = descriptor || ''
return (prev +=
url + ` ${descriptor}${index === ret.length - 1 ? '' : ', '}`)
}, '')

return url
}

// based on https://github.com/sveltejs/svelte/blob/abf11bb02b2afbd3e4cac509a0f70e318c306364/src/compiler/utils/mapped_code.ts#L221
Expand Down

0 comments on commit 4a6cf35

Please sign in to comment.