diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-06-25 10:49:03 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-06-25 11:02:15 -0700 |
commit | dc5f112c3ea8aff1a389513fa6c33d88fab07420 (patch) | |
tree | 5e887029c973d8a5b292fd9993c5ad81cf8c4c61 /sandbox/005-sandbox.mu | |
parent | d2f0704962eb0e43f3db8b461dd6d48ee9297f73 (diff) | |
download | mu-dc5f112c3ea8aff1a389513fa6c33d88fab07420.tar.gz |
3958
Improvement on fix 3957: rather than put a band-aid over a slow operation, eliminate the slowdown entirely. In this case it turns out we're unnecessarily saving files to disk when they could never be modified. Are we doing this on F4 as well?!
Diffstat (limited to 'sandbox/005-sandbox.mu')
-rw-r--r-- | sandbox/005-sandbox.mu | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index 0d14a42e..c913e796 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -217,16 +217,22 @@ def save-sandboxes env:&:environment, resources:&:resources -> resources:&:resou idx:num <- copy 0 { break-unless curr - data:text <- get *curr, data:offset - filename:text <- append [lesson/], idx - resources <- dump resources, filename, data - <end-save-sandbox> + resources <- save-sandbox resources, curr, idx idx <- add idx, 1 curr <- get *curr, next-sandbox:offset loop } ] +def save-sandbox resources:&:resources, sandbox:&:sandbox, sandbox-index:num -> resources:&:resources [ + local-scope + load-ingredients + data:text <- get *sandbox, data:offset + filename:text <- append [lesson/], sandbox-index + resources <- dump resources, filename, data + <end-save-sandbox> +] + def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:render-recipe -> screen:&:screen, env:&:environment [ local-scope load-ingredients |