[librsvg/rustification] marker.rs: Remove superfluous checks



commit 0287b4982118f66e8b7059a3d6aa5aa76bce7b32
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Oct 31 20:45:37 2016 -0600

    marker.rs: Remove superfluous checks
    
    angle_from_vector() is able to compute a sensible angle even if both
    of the vector's components are zero, so just use it like that.

 rust/src/marker.rs |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/rust/src/marker.rs b/rust/src/marker.rs
index 0dd4bd6..e40d2c8 100644
--- a/rust/src/marker.rs
+++ b/rust/src/marker.rs
@@ -420,17 +420,8 @@ pub extern fn rsvg_rust_render_markers (ctx: *mut RsvgDrawingCtx,
                         let incoming: f64;
                         let outgoing: f64;
 
-                        if has_incoming {
-                            incoming = angle_from_vector (incoming_vx, incoming_vy);
-                        } else {
-                            incoming = 0.0;
-                        }
-
-                        if has_outgoing {
-                            outgoing = angle_from_vector (outgoing_vx, outgoing_vy);
-                        } else {
-                            outgoing = 0.0;
-                        }
+                        incoming = angle_from_vector (incoming_vx, incoming_vy);
+                        outgoing = angle_from_vector (outgoing_vx, outgoing_vy);
 
                         let angle: f64;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]