You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by uw...@apache.org on 2018/04/09 07:20:39 UTC
[arrow] branch master updated: ARROW-2418: [Rust] BUG FIX: reserve
memory when building list
This is an automated email from the ASF dual-hosted git repository.
uwe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new f88949b ARROW-2418: [Rust] BUG FIX: reserve memory when building list
f88949b is described below
commit f88949b7c04b834a2f397080cf18308698e6b5d6
Author: Andy Grove <an...@gmail.com>
AuthorDate: Mon Apr 9 09:20:17 2018 +0200
ARROW-2418: [Rust] BUG FIX: reserve memory when building list
Author: Andy Grove <an...@gmail.com>
Closes #1857 from andygrove/list_reserve_mem and squashes the following commits:
a2edda2 <Andy Grove> BUG FIX: reserve memory when building list
---
rust/src/list.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/rust/src/list.rs b/rust/src/list.rs
index 461f8e6..a7b11a6 100644
--- a/rust/src/list.rs
+++ b/rust/src/list.rs
@@ -44,7 +44,9 @@ impl From<Vec<String>> for List<u8> {
let mut buf = BytesMut::with_capacity(v.len() * 32);
offsets.push(0_i32);
v.iter().for_each(|s| {
- buf.put(s.as_bytes());
+ let slice = s.as_bytes();
+ buf.reserve(slice.len());
+ buf.put(slice);
offsets.push(buf.len() as i32);
});
List {
--
To stop receiving notification emails like this one, please contact
uwe@apache.org.