perf: copy as needed

pull/24376/head
Edd Robinson 2020-12-04 17:36:14 +00:00
parent 99003b0a6a
commit e1b57aaec4
1 changed files with 2 additions and 2 deletions

View File

@ -413,7 +413,7 @@ impl Segment {
// non-empty sets. // non-empty sets.
let group_keys = encoded_groups let group_keys = encoded_groups
.iter() .iter()
.map(|ids| ids.keys().cloned()) .map(|ids| ids.keys())
.multi_cartesian_product(); .multi_cartesian_product();
// Let's figure out which of the candidate group keys are actually // Let's figure out which of the candidate group keys are actually
@ -451,7 +451,7 @@ impl Segment {
// be safe to use `small_vec` here without blowing the stack up. // be safe to use `small_vec` here without blowing the stack up.
let mut material_key = Vec::with_capacity(group_key.len()); let mut material_key = Vec::with_capacity(group_key.len());
for (col_idx, &encoded_id) in group_key.iter().enumerate() { for (col_idx, &encoded_id) in group_key.iter().enumerate() {
material_key.push(group_columns[col_idx].decode_id(encoded_id)); material_key.push(group_columns[col_idx].decode_id(*encoded_id));
} }
result.group_keys.push(material_key); result.group_keys.push(material_key);