]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
sandbox: Use dict to store bind mounts instead of set
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 15 Jan 2025 21:59:59 +0000 (22:59 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 16 Jan 2025 07:25:32 +0000 (08:25 +0100)
dict guarantee iteration in insertion order, set does not which matters
in this specific case.

mkosi/sandbox.py

index 5fd5bf2fc7445ab928dbdbbe846a4774bf5a63c3..55cad993251f1f622ef5dda0ff05ad16ec581d80 100755 (executable)
@@ -428,12 +428,12 @@ class FSOperation:
 
     @classmethod
     def optimize(cls, fsops: list["FSOperation"]) -> list["FSOperation"]:
-        binds = set()
+        binds: dict[BindOperation, None] = {}
         rest = []
 
         for fsop in fsops:
             if isinstance(fsop, BindOperation):
-                binds.add(fsop)
+                binds[fsop] = None
             else:
                 rest.append(fsop)