From 7fedba39311295d391dc7ec107f58683462a32b0 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 30 Sep 2021 16:34:26 -0600 Subject: [PATCH] optimizations on when to do NAT processing --- src/nat/ArchiveController.kiss | 2 +- src/nat/CLI.kiss | 1 + src/nat/System.kiss | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nat/ArchiveController.kiss b/src/nat/ArchiveController.kiss index 8a1b23e..4be501b 100644 --- a/src/nat/ArchiveController.kiss +++ b/src/nat/ArchiveController.kiss @@ -107,7 +107,7 @@ &mut lastCollector (lambda [] (set lastChangeSet (the ChangeSet (Reflect.callMethod null command.handler collectedArgs))) - (ui.handleChanges archive lastChangeSet))] + (when lastChangeSet (ui.handleChanges archive lastChangeSet)))] // To facilitate asynchronous arg input via UI, we need to construct an insanely complicated nested callback to give the UI (doFor arg (reversed command.args) (set lastCollector (_composeArgCollector collectedArgs arg lastCollector))) diff --git a/src/nat/CLI.kiss b/src/nat/CLI.kiss index 8ab855e..45df310 100644 --- a/src/nat/CLI.kiss +++ b/src/nat/CLI.kiss @@ -82,6 +82,7 @@ (method handleChanges [:Archive archive :ChangeSet changeSet] + (archive.processSystems) (doFor e changeSet (print (archive.fullString e)))) diff --git a/src/nat/System.kiss b/src/nat/System.kiss index 3577251..c24db8e 100644 --- a/src/nat/System.kiss +++ b/src/nat/System.kiss @@ -2,8 +2,7 @@ (method :Void process [:Archive archive] (doFor e (entries.iterator) - (processEntry archive e) - (archive.refreshEntry e))) + (processEntry archive e))) (defNew [&prop :EntryChecker canProcessEntry &prop :EntryProcessor processEntry] @@ -18,4 +17,4 @@ (entries.remove e.id) (when onRemoveEntry (onRemoveEntry archive e))))) -// TODO systems may need access to a UI +// TODO systems may need access to a UI or ArchiveController