1 |
On 2/23/22 20:14, Matt Turner wrote:
|
2 |
> From: "Wolfgang E. Sanyer" <WolfgangESanyer@×××××.com> |
3 |
> |
4 |
> Reviewed-by: Matt Turner <mattst88@g.o> |
5 |
> Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@×××××.com> |
6 |
> --- |
7 |
> lib/portage/eapi.py | 155 ++++++++++++++++++++------------------------ |
8 |
> 1 file changed, 72 insertions(+), 83 deletions(-) |
9 |
> |
10 |
> diff --git a/lib/portage/eapi.py b/lib/portage/eapi.py |
11 |
> index 56e64620a..efcc6c2a0 100644 |
12 |
> --- a/lib/portage/eapi.py |
13 |
> +++ b/lib/portage/eapi.py |
14 |
> @@ -2,12 +2,10 @@ |
15 |
> # Distributed under the terms of the GNU General Public License v2 |
16 |
> |
17 |
> import collections |
18 |
> -import operator |
19 |
> -import types |
20 |
> - |
21 |
> -from portage import eapi_is_supported |
22 |
> +from functools import lru_cache |
23 |
> |
24 |
> |
25 |
> +@lru_cache(None) |
26 |
> def eapi_has_iuse_defaults(eapi): |
27 |
> if eapi is None: |
28 |
> return True |
29 |
> @@ -15,6 +13,7 @@ def eapi_has_iuse_defaults(eapi): |
30 |
> return eapi != "0" |
31 |
|
32 |
I think this patch misses the point of the original caching mechanism.
|
33 |
It doesn't make sense to cache results of the individual eapi_*
|
34 |
functions if they no longer contribute to the _eapi_attrs cache.
|
35 |
--
|
36 |
Thanks,
|
37 |
Zac |