mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Avoid array write if length is zero.
This commit is contained in:
parent
141d4804b0
commit
feceaf429e
1 changed files with 4 additions and 0 deletions
|
|
@ -1006,6 +1006,10 @@ func (c *container) WriteTo(w io.Writer) (n int64, err error) {
|
|||
}
|
||||
|
||||
func (c *container) arrayWriteTo(w io.Writer) (n int64, err error) {
|
||||
if len(c.array) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
nn, err := w.Write((*[0xFFFFFFF]byte)(unsafe.Pointer(&c.array[0]))[:4*c.n])
|
||||
return int64(nn), err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue