From f7f8755215f2701698e173ad753f282231655bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Sat, 30 Jan 2021 16:30:43 -0300 Subject: Optimize lerp creation Now it uses Rc instead of Box, reducing the space and time complexity from O(2^n) to O(n^2). --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 6f26672..d6a1374 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ pub struct Bezier { pub px: Poly, pub py: Poly, pub dpx: Poly, - pub dpy: Poly + pub dpy: Poly, } impl Bezier { @@ -47,7 +47,7 @@ impl Bezier { self.degree -= 1; } - pub fn show_x(&self) -> String{ + pub fn show_x(&self) -> String { let mut s = String::new(); for i in 0..self.degree { s.push_str(&self.vx[i].to_string()); -- cgit v1.2.3