Skip to content

Commit 091a6dd

Browse files
committed
swap stuff to soon allocate less
1 parent 5e16a5a commit 091a6dd

3 files changed

Lines changed: 322 additions & 258 deletions

File tree

src/app.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ impl App {
4646
var: rupl::types::Vec2::new(options.xr.0, options.xr.1),
4747
count_changed: false,
4848
};
49-
let (graph, complex) = if graphing_mode.x && graphing_mode.y {
49+
let mut graph = Vec::new();
50+
let complex = if graphing_mode.x && graphing_mode.y {
5051
data.generate_3d(
5152
options.xr.0,
5253
options.yr.0,
@@ -55,9 +56,16 @@ impl App {
5556
options.samples_3d.0,
5657
options.samples_3d.1,
5758
None,
59+
&mut graph,
5860
)
5961
} else {
60-
data.generate_2d(options.xr.0, options.xr.1, options.samples_2d, None)
62+
data.generate_2d(
63+
options.xr.0,
64+
options.xr.1,
65+
options.samples_2d,
66+
None,
67+
&mut graph,
68+
)
6169
};
6270
let names = get_names(&graph, &names);
6371
if options.vxr.0 != 0.0 || options.vxr.1 != 0.0 {

0 commit comments

Comments
 (0)