Generate SSD storage child traversal from typed Jerboa

ober

2c83a0afbc2182ada507f6f13356f14440d7ba39

diff --git a/templates/ssd-review.ss b/templates/ssd-review.ss
index 7d86123..1d0f0e5 100644
--- a/templates/ssd-review.ss
+++ b/templates/ssd-review.ss
@@ -2089,6 +2089,7 @@
                 truthStoreMakePinnedTrustManager
                 zipEntryPresent
                 zipEntryIsDirectory zipEntryIsFile zipEntryDeclaresExcessiveSize
+                forEachFileArray
                 countInstalledStagedZipEntries)
         (type File)
         (type Path)
@@ -2115,6 +2116,16 @@
           (kotlin-member-call listFiles))
         (extern (fileParentFileRaw (file : File)) : (Nullable File)
           (kotlin-member-get parentFile))
+        (def (forEachFileArray
+               (files : (Array File))
+               (action : (-> File Unit))) : Unit
+          (begin
+            (for/fold ((ignored (int32 0)))
+                      ((i (in-range (int32 0) (list-size files))))
+              (begin
+                (invoke action (list-ref files i))
+                ignored))
+            (begin)))
         (extern (pathIsSymbolicLinkRaw (path : Path)) : Bool
           (kotlin-call Files isSymbolicLink))
         (extern (pathParent (path : Path)) : Path
@@ -11828,7 +11839,9 @@
        "            if (fileIsSymbolicLink(file)) throw IllegalStateException(\"Storage symlink rejected\")"
        "            if (fileIsDirectory(file)) {"
        "                if (fileListFilesPresent(file)) {"
-       "                    checkNotNull(file.listFiles()).forEach { walk(it, depth + 1) }"
+       "                    forEachFileArray(checkNotNull(file.listFiles())) { child ->"
+       "                        walk(child, depth + 1)"
+       "                    }"
        "                }"
        "            } else if (fileIsRegular(file)) {"
        "                stats.files += 1"