From 2dc42b4a22ffc31a83297bfed7641e3737a0a940 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sat, 26 Jun 2021 20:27:44 +0100 Subject: [PATCH] Use less iterator magic to avoid compile error on phone --- glow/src/quad.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/glow/src/quad.rs b/glow/src/quad.rs index 16bfb25b..fd1deb97 100644 --- a/glow/src/quad.rs +++ b/glow/src/quad.rs @@ -150,19 +150,14 @@ impl Pipeline { unsafe { tagged_instances.clear(); - tagged_instances.extend( - instances[i..end] - .iter() - .map(|v| { - [ - QuadWithQPos(*v, pos_map[0]), - QuadWithQPos(*v, pos_map[1]), - QuadWithQPos(*v, pos_map[2]), - QuadWithQPos(*v, pos_map[3]), - ] - }) - .flatten(), - ); + tagged_instances.reserve((end - i) * 4); + + for quad in instances[i..end].iter() { + tagged_instances.push(QuadWithQPos(*quad, pos_map[0])); + tagged_instances.push(QuadWithQPos(*quad, pos_map[1])); + tagged_instances.push(QuadWithQPos(*quad, pos_map[2])); + tagged_instances.push(QuadWithQPos(*quad, pos_map[3])); + } gl.buffer_sub_data_u8_slice( glow::ARRAY_BUFFER,