Skip to content

Commit

Permalink
Re-use same ByteArrayOutputStream buffer, to make OOM less likely
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Oct 11, 2024
1 parent 4de39d0 commit 0432d8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ internal interface LargeBackupTestBase : LargeTestBase {

private fun spyOnFullBackupData(backupResult: SeedvaultLargeTestResult) {
var packageName: String? = null
var dataIntercept = ByteArrayOutputStream()
val dataIntercept = ByteArrayOutputStream()

coEvery {
spyFullBackup.performFullBackup(any(), any(), any())
Expand All @@ -179,7 +179,7 @@ internal interface LargeBackupTestBase : LargeTestBase {
backupResult.full[packageName!!] = dataIntercept.toByteArray().sha256()

packageName = null
dataIntercept = ByteArrayOutputStream()
dataIntercept.reset()
result
}
}
Expand Down

0 comments on commit 0432d8b

Please sign in to comment.