Browse code

Memoize

Robert Cranston authored on 15/01/2023 09:25:59
Showing 1 changed files

... ...
@@ -121,6 +121,7 @@ import os
121 121
 import sys
122 122
 import collections
123 123
 import re
124
+import functools
124 125
 import subprocess
125 126
 import shutil
126 127
 import shlex
... ...
@@ -415,6 +416,7 @@ def enum(xml, value):
415 416
 
416 417
 
417 418
 ### `supports`
419
+@functools.cache
418 420
 def supports(xml, name, use_aliases=True):
419 421
     category, attrib = CATEGORY_ATTRIBS['EXTENSION']
420 422
     if xml.xpath(f"{category}[@{attrib}='{name}']"):