Skip to content

Commit a42bf33

Browse files
authored
Merge pull request #122 from opsmill/pog-perf102
When using only the values of a dict use the `values()` method
2 parents 2d62940 + eadb33a commit a42bf33

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

infrahub_sdk/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _get(self, key: str, kind: Optional[Union[str, type[SchemaType]]] = None, ra
5858
if kind_name and kind_name in self._store and key in self._store[kind_name]: # type: ignore[attr-defined]
5959
return self._store[kind_name][key] # type: ignore[attr-defined]
6060

61-
for _, item in self._store.items(): # type: ignore[attr-defined]
61+
for item in self._store.values(): # type: ignore[attr-defined]
6262
if key in item:
6363
return item[key]
6464

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ ignore = [
249249
"FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups
250250
"N802", # Function name should be lowercase
251251
"N806", # Variable in function should be lowercase
252-
"PERF102", # When using only the values of a dict use the `values()` method
253252
"PERF203", # `try`-`except` within a loop incurs performance overhead
254253
"PERF401", # Use a list comprehension to create a transformed list
255254
"PLC0206", # Extracting value from dictionary without calling `.items()`

0 commit comments

Comments
 (0)