From b39a332a3d893a87e1205c627dd2580edc5e2e08 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Sat, 11 Jan 2025 14:56:45 +0000 Subject: [PATCH] refactor --- crates/bevy_text/src/text2d.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs index c3dcac4515e6a..c7444b53262c5 100644 --- a/crates/bevy_text/src/text2d.rs +++ b/crates/bevy_text/src/text2d.rs @@ -211,14 +211,9 @@ pub fn extract_text2d_sprite( size: rect.size(), }); - if text_layout_info - .glyphs - .get(i + 1) - .map(|info| { - info.span_index != current_span || info.atlas_info.texture != atlas_info.texture - }) - .unwrap_or(true) - { + if text_layout_info.glyphs.get(i + 1).is_none_or(|info| { + info.span_index != current_span || info.atlas_info.texture != atlas_info.texture + }) { let render_entity = commands.spawn(TemporaryRenderEntity).id(); extracted_sprites.sprites.insert( entities_iter