[pacman-dev] [PATCH] Eliminate extra loop over dbs_sync
Current flow looks like
loop dbs_sync {
loop pkgs {
if pkg.db == db then process(pkg, db)
}
}
Package sync transaction always has a counterpart in the dbs_sync list
(I cannot come up with a use-case when it is not true). So the loop can
be simplified to:
loop pkgs {
process(pkg, pkg.db)
}
Tested: 'ninja test' & manually by using pacman with this patch for a
week
Signed-off-by: Anatol Pomozov
On 30/1/20 3:27 pm, Anatol Pomozov wrote:
Current flow looks like loop dbs_sync { loop pkgs { if pkg.db == db then process(pkg, db) } }
Package sync transaction always has a counterpart in the dbs_sync list (I cannot come up with a use-case when it is not true). So the loop can be simplified to:
loop pkgs { process(pkg, pkg.db) }
Tested: 'ninja test' & manually by using pacman with this patch for a week Signed-off-by: Anatol Pomozov
I have been trying to figure out if there was an historical reason for this... The loops was added in: d37ad0487 (Aaron Griffin 2006-10-15 19:31:03 +0000 805) which is a big merge from Frugalware. So in short, this looks fine to me. Allan
On 31/1/20 12:37 am, Allan McRae wrote:
On 30/1/20 3:27 pm, Anatol Pomozov wrote:
Current flow looks like loop dbs_sync { loop pkgs { if pkg.db == db then process(pkg, db) } }
Package sync transaction always has a counterpart in the dbs_sync list (I cannot come up with a use-case when it is not true). So the loop can be simplified to:
loop pkgs { process(pkg, pkg.db) }
Tested: 'ninja test' & manually by using pacman with this patch for a week Signed-off-by: Anatol Pomozov
I have been trying to figure out if there was an historical reason for this... The loops was added in:
d37ad0487 (Aaron Griffin 2006-10-15 19:31:03 +0000 805)
which is a big merge from Frugalware.
So in short, this looks fine to me.
I haven't confirmed... but it likely effects download order. Currently downloads occur roughly in repo order. I don't think it matters, but thought I would flag it anyway. Allan
participants (2)
-
Allan McRae
-
Anatol Pomozov