File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -157,18 +157,8 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
157157 // Shifting all the offsets
158158 let shift: T :: Offset = self . next_offset ( ) - offsets[ 0 ] ;
159159
160- use num:: Zero ;
161-
162- // Creating intermediate offsets instead of pushing each offsets is faster.
163- //
164- // Not using Vec::with_capacity and push as it will not use SIMD for some reason.
165- let mut intermediate = vec ! [ T :: Offset :: zero( ) ; offsets. len( ) - 1 ] ;
166-
167- for ( index, & offset) in offsets[ 1 ..] . iter ( ) . enumerate ( ) {
168- intermediate[ index] = offset + shift;
169- }
170-
171- self . offsets_builder . extend_from_slice ( & intermediate) ;
160+ self . offsets_builder
161+ . extend ( offsets[ 1 ..] . iter ( ) . map ( |& offset| offset + shift) ) ;
172162 }
173163
174164 // Append underlying values, starting from the first offset and ending at the last offset
You can’t perform that action at this time.
0 commit comments