From 7c7978c12e75a5c1d10d03e2c79b8dfe0320f300 Mon Sep 17 00:00:00 2001 From: udf2457 Date: Fri, 28 Aug 2026 22:28:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=8Einternal/stream:=20simplify=20a=20min(?= =?UTF-8?q?)=20computation=20in=20tests=20(#727)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/stream/stream_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/stream/stream_test.go b/internal/stream/stream_test.go index 7d0f7b3..9e4c42a 100644 --- a/internal/stream/stream_test.go +++ b/internal/stream/stream_test.go @@ -266,10 +266,7 @@ func TestDecryptReaderAt(t *testing.T) { // Verify data correctness if n > 0 && off >= 0 && off < int64(plaintextSize) { - end := int(off) + n - if end > plaintextSize { - end = plaintextSize - } + end := min(int(off)+n, plaintextSize) if !bytes.Equal(p[:n], plaintext[off:end]) { t.Errorf("%s: data mismatch", name) }