]> Cypherpunks repositories - gostls13.git/commit
internal/zstd: optimize skipFrame by using io.CopyN
authoraimuz <mr.imuz@gmail.com>
Wed, 25 Sep 2024 14:25:58 +0000 (14:25 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 26 Sep 2024 17:06:55 +0000 (17:06 +0000)
commitca1123f9c51e95d4b2383fbfe1652d70b373aac6
tree68859d995f40d80b09592b04d0ee0db9b201e406
parentba42120723a8bb4161c4f54c93f7ab3234923473
internal/zstd: optimize skipFrame by using io.CopyN

Replaced the manual byte skipping logic with io.CopyN
to improve performance and reduce memory allocation.
This change simplifies the code by directly discarding
the bytes read, enhancing readability and efficiency.

Change-Id: Id11496d072fb554c394947d08e63616ca48ecab4
GitHub-Last-Rev: dc5f836cc76ea1355effa49a665b9091a888541b
GitHub-Pull-Request: golang/go#69619
Reviewed-on: https://go-review.googlesource.com/c/go/+/615716
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/internal/zstd/zstd.go