Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH 01/14] Use public API: hashfunc_map -> get_valid_checksum_keys()
Date: Sun, 12 Mar 2017 20:36:23
Message-Id: CAMiTYSp8rSxTV8ypgxR+w8S_kzkU0xQ69ioAi+m6N-OJYAjTag@mail.gmail.com
In Reply to: [gentoo-portage-dev] [PATCH 01/14] Use public API: hashfunc_map -> get_valid_checksum_keys() by "Michał Górny"
1 On Sun, Mar 12, 2017 at 11:59 AM, Michał Górny <mgorny@g.o> wrote:
2 > Use get_valid_checksum_keys() function instead of accessing hashfunc_map
3 > directly throughout the Portage.
4 > ---
5 > pym/portage/_emirrordist/FetchTask.py | 2 +-
6 > pym/portage/dbapi/bintree.py | 4 ++--
7 > pym/portage/eclass_cache.py | 2 +-
8 > pym/portage/manifest.py | 4 ++--
9 > pym/portage/package/ebuild/fetch.py | 10 +++++-----
10 > 5 files changed, 11 insertions(+), 11 deletions(-)
11 >
12 > diff --git a/pym/portage/_emirrordist/FetchTask.py b/pym/portage/_emirrordist/FetchTask.py
13 > index 64de67582..203b8c213 100644
14 > --- a/pym/portage/_emirrordist/FetchTask.py
15 > +++ b/pym/portage/_emirrordist/FetchTask.py
16 > @@ -574,7 +574,7 @@ class FetchTask(CompositeTask):
17 > else:
18 > for hash_name in self.digests:
19 > if hash_name != "size" and \
20 > - hash_name in portage.checksum.hashfunc_map:
21 > + hash_name in portage.checksum.get_valid_checksum_keys():
22
23 The get_valid_checksum_keys function creates a list for each call, so
24 this is a lot less efficient that dict hash table lookup that it was
25 before.
26 --
27 Thanks,
28 Zac

Replies