Memoize the result of spack.platforms.host() (#26573)

This commit is contained in:
Harmen Stoppels 2021-10-07 14:04:05 +02:00 committed by GitHub
parent 20ee786d09
commit 05834e7c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@
platforms = [Cray, Darwin, Linux, Test]
@llnl.util.lang.memoized
def _host():
"""Detect and return the platform for this machine or None if detection fails."""
for platform_cls in sorted(platforms, key=lambda plt: plt.priority):