aboutsummaryrefslogtreecommitdiff
path: root/lib/text/chunk.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-10 23:36:27 +0700
committerShulhan <ms@kilabit.info>2023-09-11 02:26:33 +0700
commit9d05da3b79182f0fa63c268cc9c028482ae6a1c9 (patch)
tree8bd26fb347a1672f597375da4099d784770ac9a3 /lib/text/chunk.go
parentdb97fff977fd18992bddc411b769893edb1dd86e (diff)
downloadpakakeh.go-9d05da3b79182f0fa63c268cc9c028482ae6a1c9.tar.xz
lib/text: realign struct for better size allocation
The realignment reduce the cost of the following struct, * Chunk: from 16 to 8 bytes (-8) * struct in TestChunk_MarshalJSON: from 40 to 32 bytes (-8) * diff.LineChange: from 96 to 88 bytes (-8) * Line: from 16 to 8 bytes (-8) * struct in TestLine_MarshalJSON: from 40 to 32 bytes (-8)
Diffstat (limited to 'lib/text/chunk.go')
-rw-r--r--lib/text/chunk.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/text/chunk.go b/lib/text/chunk.go
index ddf2edc4..9a2db9e6 100644
--- a/lib/text/chunk.go
+++ b/lib/text/chunk.go
@@ -13,8 +13,8 @@ import (
// Chunk represent subset of line, contain starting position and slice of
// bytes in line.
type Chunk struct {
- StartAt int
V []byte
+ StartAt int
}
// JoinChunks all chunk's values using `sep` as separator and return it as