Skip to content

Commit

Permalink
feat: Improve Perf
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Dec 17, 2024
1 parent 4934153 commit c1a2fc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/grain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2490,12 +2490,12 @@ impl Bindgen for FunctionBindgen<'_, '_> {
self.push_str(&format!("let mut {} = []\n", result));
self.push_str(&format!("Memory.incRef(WasmI32.fromGrain({}))\n", result));

self.push_str("for (let mut i = ");
self.push_str("for (let mut i = WasmI32.(-)(");
self.push_str(&len);
self.push_str("; WasmI32.gtU(i, 0n); i = WasmI32.(-)(i, 1n)) {\n");
self.push_str(", 1n); WasmI32.(!=)(i, -1n); i = WasmI32.(-)(i, 1n)) {\n");
self.push_str("let base = WasmI32.(+)(");
self.push_str(&base);
self.push_str(", WasmI32.(*)(WasmI32.(-)(i, 1n), ");
self.push_str(", WasmI32.(*)(i, ");
self.push_str(&size.to_string());
self.push_str("n))\n");
self.push_str(&body);
Expand Down

0 comments on commit c1a2fc0

Please sign in to comment.