Don't recompute 'all_ports_all_boards'

This looks modestly expensive, and it's trivial to cache it.
This commit is contained in:
Jeff Epler 2022-10-14 11:06:35 -05:00
parent cab4063057
commit 25164030e2
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -27,6 +27,7 @@ import pathlib
import re
import subprocess
import sys
import functools
from concurrent.futures import ThreadPoolExecutor
@ -275,6 +276,7 @@ def lookup_setting(settings, key, default=''):
key = value[2:-1]
return value
@functools.cache
def all_ports_all_boards(ports=SUPPORTED_PORTS):
for port in ports: