download: copy bundle into buffer only if needed (#5767)
The need would be if `d.persist` is true: we're writing it into a file in a later code path. However, if we don't have bundle persistency enabled, this should allow us to get rid of one copy of the bundle in memory. To achieve that, the mechanism used to figure out the bundle size is replaced: - Before, we'd write it into a buffer that we might not need, and use its Len() - After, we're writing it into a no-op io.Writer that only keeps track of the bytes read. Signed-off-by: Stephan Renatus <stephan@styra.com>
S
Stephan Renatus committed
8fd78011a8a42ec8ebacbea0d37f31b6d4e784f1
Parent: c6a341b
Committed by GitHub <noreply@github.com>
on 3/17/2023, 9:48:36 AM