From 308db1f94cc5031371dad30248fc3041c7741b09 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 13 Jun 2023 22:53:52 -0700 Subject: [PATCH] cache get_csv --- src/openpower/decoder/power_enums.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index 6e32fb99..fb90b135 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -40,6 +40,12 @@ def find_wiki_file(name): def get_csv(name): + retval = _get_csv(name) + return [i.copy() for i in retval] + + +@functools.lru_cache() +def _get_csv(name): """gets a not-entirely-csv-file-formatted database, which allows comments """ file_path = find_wiki_file(name) -- 2.30.2