[pacman-dev] [PATCH] Eliminate extra loop over dbs_sync
Allan McRae
allan at archlinux.org
Thu Jan 30 14:37:51 UTC 2020
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 <anatol.pomozov at gmail.com>
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
More information about the pacman-dev
mailing list