gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 227Rust 7TOML 3CSS 1307 Definiciones

Remove unneeded scope

b9a8938f53128ba82d1782ccb66ed8e2b19b664c · por Emil Sjölander · (hace 7 años) · padre cc8257a5d · ver el árbol en este commit

Delta semántico · 1

src/algo.rs

1 archivos · +17 −19

diff --git a/src/algo.rs b/src/algo.rs
index acd9b0e17..51dd24c91 100644
--- a/src/algo.rs
+++ b/src/algo.rs
@@ -140,28 +140,26 @@ fn compute_internal(
     node.is_dirty = false;
 
     // First we check if we have a result for the given input
-    {
-        if let Some(cache) = &node.layout_cache {
-            if cache.perform_layout || !perform_layout {
-                let width_compatible = if let Number::Defined(width) = node_size.width {
-                    (width - cache.result.size.width).abs() < f32::EPSILON
-                } else {
-                    cache.node_size.width.is_undefined()
-                };
+    if let Some(cache) = &node.layout_cache {
+        if cache.perform_layout || !perform_layout {
+            let width_compatible = if let Number::Defined(width) = node_size.width {
+                (width - cache.result.size.width).abs() < f32::EPSILON
+            } else {
+                cache.node_size.width.is_undefined()
+            };
 
-                let height_compatible = if let Number::Defined(height) = node_size.height {
-                    (height - cache.result.size.height).abs() < f32::EPSILON
-                } else {
-                    cache.node_size.height.is_undefined()
-                };
+            let height_compatible = if let Number::Defined(height) = node_size.height {
+                (height - cache.result.size.height).abs() < f32::EPSILON
+            } else {
+                cache.node_size.height.is_undefined()
+            };
 
-                if width_compatible && height_compatible {
-                    return Ok(cache.result.clone());
-                }
+            if width_compatible && height_compatible {
+                return Ok(cache.result.clone());
+            }
 
-                if cache.node_size == node_size && cache.parent_size == parent_size {
-                    return Ok(cache.result.clone());
-                }
+            if cache.node_size == node_size && cache.parent_size == parent_size {
+                return Ok(cache.result.clone());
             }
         }
     }