File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -157,16 +157,8 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
157157 // Shifting all the offsets
158158 let shift: T :: Offset = self . next_offset ( ) - offsets[ 0 ] ;
159159
160- // Creating intermediate offsets instead of pushing each offset is faster
161- // (even if we make MutableBuffer to avoid updating length on each push
162- // and reserve the necessary capacity, it's still slower)
163- let mut intermediate = Vec :: with_capacity ( offsets. len ( ) - 1 ) ;
164-
165- for & offset in & offsets[ 1 ..] {
166- intermediate. push ( offset + shift)
167- }
168-
169- self . offsets_builder . extend_from_slice ( & intermediate) ;
160+ self . offsets_builder
161+ . extend ( offsets[ 1 ..] . iter ( ) . map ( |& offset| offset + shift) ) ;
170162 }
171163
172164 // 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