param: optimize fix for exponential memory allocation (#10180)

* param: simplify fix for exponential memory allocation

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove `deepcopy` again

* Restore deepcopy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Helio Machado
2023-12-18 08:37:31 +05:45
committed by GitHub
co-authored by pre-commit-ci[bot]
parent abcd70b9cf
commit 72ab5a12df
+2 -1
View File
@@ -57,8 +57,9 @@ def read_param_file(
from copy import deepcopy
from dpath import merge
from funcy import distinct
for key_path in key_paths:
for key_path in distinct(key_paths):
merge(
ret,
deepcopy(dpath.search(config, key_path, separator=".")),