From 004f47502ca074bd2591e215512fd2e18bd8659a Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 16 Sep 2023 23:18:02 +0700 Subject: bufio: realign struct Scanner This reduce the Scanner allocation size from 112 to 72 bytes. --- src/bufio/scan.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bufio/scan.go') diff --git a/src/bufio/scan.go b/src/bufio/scan.go index a26b2ff17d..ce4c1721d4 100644 --- a/src/bufio/scan.go +++ b/src/bufio/scan.go @@ -29,12 +29,12 @@ import ( type Scanner struct { r io.Reader // The reader provided by the client. split SplitFunc // The function to split the tokens. - maxTokenSize int // Maximum size of a token; modified by tests. + err error // Sticky error. token []byte // Last token returned by split. buf []byte // Buffer used as argument to split. + maxTokenSize int // Maximum size of a token; modified by tests. start int // First non-processed byte in buf. end int // End of data in buf. - err error // Sticky error. empties int // Count of successive empty tokens. scanCalled bool // Scan has been called; buffer is in use. done bool // Scan has finished. -- cgit v1.3