Skip to content

Commit

Permalink
vector: Remove unncessary Nulls is nil check (#5303)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnibs authored Sep 28, 2024
1 parent d103420 commit 9ff04da
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion vector/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (a *Array) Len() uint32 {
}

func (a *Array) Serialize(b *zcode.Builder, slot uint32) {
if a.Nulls != nil && a.Nulls.Value(slot) {
if a.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (b *Bool) CopyWithBits(bits []uint64) *Bool {
}

func (b *Bool) Serialize(builder *zcode.Builder, slot uint32) {
if b.Nulls != nil && b.Nulls.Value(slot) {
if b.Nulls.Value(slot) {
builder.Append(nil)
} else {
builder.Append(zed.EncodeBool(b.Value(slot)))
Expand Down
2 changes: 1 addition & 1 deletion vector/bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (b *Bytes) Serialize(builder *zcode.Builder, slot uint32) {
}

func (b *Bytes) Value(slot uint32) []byte {
if b.Nulls != nil && b.Nulls.Value(slot) {
if b.Nulls.Value(slot) {
return nil
}
return b.Bytes[b.Offs[slot]:b.Offs[slot+1]]
Expand Down
2 changes: 1 addition & 1 deletion vector/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Const) Value() zed.Value {
}

func (c *Const) Serialize(b *zcode.Builder, slot uint32) {
if c.Nulls != nil && c.Nulls.Value(slot) {
if c.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(c.val.Bytes())
Expand Down
2 changes: 1 addition & 1 deletion vector/dict.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (d *Dict) Len() uint32 {
}

func (d *Dict) Serialize(builder *zcode.Builder, slot uint32) {
if d.Nulls != nil && d.Nulls.Value(slot) {
if d.Nulls.Value(slot) {
builder.Append(nil)
} else {
d.Any.Serialize(builder, uint32(d.Index[slot]))
Expand Down
2 changes: 1 addition & 1 deletion vector/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (e *Error) Len() uint32 {
}

func (e *Error) Serialize(b *zcode.Builder, slot uint32) {
if e.Nulls != nil && e.Nulls.Value(slot) {
if e.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (f *Float) Value(slot uint32) float64 {
}

func (f *Float) Serialize(b *zcode.Builder, slot uint32) {
if f.Nulls != nil && f.Nulls.Value(slot) {
if f.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (i *Int) Value(slot uint32) int64 {
}

func (i *Int) Serialize(b *zcode.Builder, slot uint32) {
if i.Nulls != nil && i.Nulls.Value(slot) {
if i.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(zed.EncodeInt(i.Values[slot]))
Expand Down
2 changes: 1 addition & 1 deletion vector/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (i *IP) Len() uint32 {
}

func (i *IP) Serialize(b *zcode.Builder, slot uint32) {
if i.Nulls != nil && i.Nulls.Value(slot) {
if i.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(zed.EncodeIP(i.Values[slot]))
Expand Down
2 changes: 1 addition & 1 deletion vector/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (m *Map) Len() uint32 {
}

func (m *Map) Serialize(b *zcode.Builder, slot uint32) {
if m.Nulls != nil && m.Nulls.Value(slot) {
if m.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (n *Net) Len() uint32 {
}

func (n *Net) Serialize(b *zcode.Builder, slot uint32) {
if n.Nulls != nil && n.Nulls.Value(slot) {
if n.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(zed.EncodeNet(n.Values[slot]))
Expand Down
2 changes: 1 addition & 1 deletion vector/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (r *Record) Len() uint32 {
}

func (r *Record) Serialize(b *zcode.Builder, slot uint32) {
if r.Nulls != nil && r.Nulls.Value(slot) {
if r.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (s *Set) Len() uint32 {
}

func (s *Set) Serialize(b *zcode.Builder, slot uint32) {
if s.Nulls != nil && s.Nulls.Value(slot) {
if s.Nulls.Value(slot) {
b.Append(nil)
return
}
Expand Down
2 changes: 1 addition & 1 deletion vector/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *String) Value(slot uint32) string {
}

func (s *String) Serialize(b *zcode.Builder, slot uint32) {
if s.Nulls != nil && s.Nulls.Value(slot) {
if s.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(zed.EncodeString(s.Value(slot)))
Expand Down
2 changes: 1 addition & 1 deletion vector/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (t *TypeValue) Value(slot uint32) []byte {
}

func (t *TypeValue) Serialize(b *zcode.Builder, slot uint32) {
if t.Nulls != nil && t.Nulls.Value(slot) {
if t.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(t.Value(slot))
Expand Down
2 changes: 1 addition & 1 deletion vector/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (u *Uint) Value(slot uint32) uint64 {
}

func (u *Uint) Serialize(b *zcode.Builder, slot uint32) {
if u.Nulls != nil && u.Nulls.Value(slot) {
if u.Nulls.Value(slot) {
b.Append(nil)
} else {
b.Append(zed.EncodeUint(u.Values[slot]))
Expand Down

0 comments on commit 9ff04da

Please sign in to comment.