Simplify some code in VectorisedView#ToView.

PiperOrigin-RevId: 212317717
Change-Id: Ic77449c53bf2f8be92c9f0a7a726c45bd35ec435
This commit is contained in:
Bert Muthalaly
2018-09-10 13:04:06 -07:00
committed by Shentubot
parent e198f9ab02
commit da9ecb748c
+4 -6
View File
@@ -154,13 +154,11 @@ func (vv *VectorisedView) Size() int {
// ToView returns a single view containing the content of the vectorised view.
func (vv *VectorisedView) ToView() View {
v := make([]byte, vv.size)
u := v
for i := range vv.views {
n := copy(u, vv.views[i])
u = u[n:]
u := make([]byte, 0, vv.size)
for _, v := range vv.views {
u = append(u, v...)
}
return v
return u
}
// Views returns the slice containing the all views.