diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-30 16:30:43 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2021-01-30 16:30:43 -0300 |
commit | f7f8755215f2701698e173ad753f282231655bdd (patch) | |
tree | 68879c722ea0098c0a708a6de38475cb54bb4241 /src/lib.rs | |
parent | 4998f5936dc7da36aba0cd018de2a1a6127dda08 (diff) | |
download | bezier-f7f8755215f2701698e173ad753f282231655bdd.tar.gz bezier-f7f8755215f2701698e173ad753f282231655bdd.zip |
Optimize lerp creation
Now it uses Rc instead of Box, reducing the space and time complexity
from O(2^n) to O(n^2).
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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()); |