changeset 439:27c0c60fc792

fix: yielding duplicates
author Sam <sam@basx.dev>
date Wed, 14 Feb 2024 23:15:53 +0700
parents 1ab09f8cc68d
children b1e500d0ed07
files semicongine/resources.nim tests/resources/mod1/aSubdir/moreSubdir/superSubdir/empty.stuff
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/resources.nim	Wed Feb 14 21:58:43 2024 +0700
+++ b/semicongine/resources.nim	Wed Feb 14 23:15:53 2024 +0700
@@ -112,6 +112,7 @@
         else:
           if not (components[0] in yielded):
             yield (kind: pcDir, path: components[0])
+        yielded.incl components[0]
     archive.close()
 
 elif thebundletype == Exe:
@@ -157,6 +158,7 @@
         else:
           if not (components[0] in yielded):
             yield (kind: pcDir, path: components[0])
+        yielded.incl components[0]
 
 proc loadResource*(path: string, package = DEFAULT_PACKAGE): Stream =
   loadResource_intern(path, package = package)