1 |
W dniu 12.03.2017, nie o godzinie 13∶36 -0700, użytkownik Zac Medico |
2 |
napisał: |
3 |
> On Sun, Mar 12, 2017 at 11:59 AM, Michał Górny <mgorny@g.o> wrote: |
4 |
> > Use get_valid_checksum_keys() function instead of accessing hashfunc_map |
5 |
> > directly throughout the Portage. |
6 |
> > --- |
7 |
> > pym/portage/_emirrordist/FetchTask.py | 2 +- |
8 |
> > pym/portage/dbapi/bintree.py | 4 ++-- |
9 |
> > pym/portage/eclass_cache.py | 2 +- |
10 |
> > pym/portage/manifest.py | 4 ++-- |
11 |
> > pym/portage/package/ebuild/fetch.py | 10 +++++----- |
12 |
> > 5 files changed, 11 insertions(+), 11 deletions(-) |
13 |
> > |
14 |
> > diff --git a/pym/portage/_emirrordist/FetchTask.py b/pym/portage/_emirrordist/FetchTask.py |
15 |
> > index 64de67582..203b8c213 100644 |
16 |
> > --- a/pym/portage/_emirrordist/FetchTask.py |
17 |
> > +++ b/pym/portage/_emirrordist/FetchTask.py |
18 |
> > @@ -574,7 +574,7 @@ class FetchTask(CompositeTask): |
19 |
> > else: |
20 |
> > for hash_name in self.digests: |
21 |
> > if hash_name != "size" and \ |
22 |
> > - hash_name in portage.checksum.hashfunc_map: |
23 |
> > + hash_name in portage.checksum.get_valid_checksum_keys(): |
24 |
> |
25 |
> The get_valid_checksum_keys function creates a list for each call, so |
26 |
> this is a lot less efficient that dict hash table lookup that it was |
27 |
> before. |
28 |
|
29 |
Does it really matter though? AFAICS this is just a matter of optimizing |
30 |
the function, e.g. putting the keys in a frozenset. |
31 |
|
32 |
-- |
33 |
Best regards, |
34 |
Michał Górny |