Optimize list_of_first

This commit is contained in:
Alex 2022-11-17 15:10:14 +01:00
parent c6e7a42b7e
commit 2ae904cc8a
Signed by: lx
GPG Key ID: 0E496D15096376BE
1 changed files with 1 additions and 5 deletions

View File

@ -217,11 +217,7 @@ impl<'a, 'b> Term<'a, 'b> {
let remaining_offset = remaining_begin - raw.as_ptr() as usize;
let remaining_raw = &raw[remaining_offset..];
let remaining = list[N - 1..]
.iter()
.map(|x| x.mkref())
.collect::<Vec<NonListTerm<'a, '_>>>();
ret.push(Term(AnyTerm::List(remaining_raw, remaining)));
ret.push(Term(AnyTerm::ListRef(remaining_raw, &list[N - 1..])));
Ok(ret.try_into().unwrap())
}