Skip to content

Commit c6763d6

Browse files
sethmlarsonhugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent ea5c9de commit c6763d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sbom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ class CreationInfo(TypedDict):
9292

9393
# Cache of values that we've seen already. We use this
9494
# to de-duplicate values and their corresponding SPDX ID.
95-
_SPDX_IDS_TO_VALUES = {}
95+
_SPDX_IDS_TO_VALUES: dict[str, Any] = {}
9696

9797

98+
@cache
9899
def spdx_id(value: LiteralString) -> str:
99100
"""Encode a value into characters that are valid in an SPDX ID"""
100101
spdx_id = re.sub(r"[^a-zA-Z0-9.\-]+", "-", value)

0 commit comments

Comments
 (0)