‎internal/stream: simplify a min() computation in tests (#727)

This commit is contained in:
udf2457 2026-08-28 22:28:31 +01:00 committed by GitHub
parent a68b8e921b
commit 7c7978c12e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}