File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,19 +258,18 @@ rollover:
258258 b := mc .bufs [mc .active ]
259259
260260 for i < yank && mc .slotIdx < memNumSlots {
261- slotSize := memSlotSize - 1 // 1 char for '\n'
262261 // the slot at header + slotIdx * slotSize
263- begin := memHdrSize + mc .slotIdx * slotSize
264- end := memHdrSize + (mc .slotIdx + 1 )* slotSize
262+ begin := memHdrSize + mc .slotIdx * memSlotSize
263+ end := memHdrSize + (mc .slotIdx + 1 )* memSlotSize
265264 slot := b .data [begin :end ]
266265
267- raw := all [i :min (yank , i + slotSize )]
266+ raw := all [i :min (yank , i + memSlotSize - 1 )]
268267 n := 0
269268 if ! bytes .HasPrefix (raw , lpfx ) {
270269 n = copy (slot , lpfx )
271270 }
272271 // the last byte is reserved for newline
273- m := copy (slot [n :slotSize ], raw )
272+ m := copy (slot [n :memSlotSize - 1 ], raw )
274273 slot [n + m ] = '\n'
275274 // zero-fill the tail so the reader sees no stale data
276275 clear (slot [n + m + 1 :])
You can’t perform that action at this time.
0 commit comments