Skip to content

Commit a68c86e

Browse files
Rename variables in _iter_sims for clarity
Rename lid1/lid2 to key1/key2 and lineset to lineset1 for consistency with lineset2. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 50bf6cc commit a68c86e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

pylint/checkers/symilar.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,16 +515,16 @@ def _iter_sims(self) -> Generator[Commonality]:
515515
# Cache hash_lineset results: each lineset is compared against every
516516
# other, so without caching it gets hashed (N-1) times.
517517
cache: dict[int, LineSetHashResult] = {}
518-
for idx, lineset in enumerate(self.linesets[:-1]):
518+
for idx, lineset1 in enumerate(self.linesets[:-1]):
519519
for lineset2 in self.linesets[idx + 1 :]:
520-
lid1 = id(lineset)
521-
if lid1 not in cache:
522-
cache[lid1] = hash_lineset(lineset, min_lines)
523-
lid2 = id(lineset2)
524-
if lid2 not in cache:
525-
cache[lid2] = hash_lineset(lineset2, min_lines)
520+
key1 = id(lineset1)
521+
if key1 not in cache:
522+
cache[key1] = hash_lineset(lineset1, min_lines)
523+
key2 = id(lineset2)
524+
if key2 not in cache:
525+
cache[key2] = hash_lineset(lineset2, min_lines)
526526
yield from self._find_common(
527-
lineset, lineset2, cache[lid1], cache[lid2]
527+
lineset1, lineset2, cache[key1], cache[key2]
528528
)
529529

530530
def get_map_data(self) -> list[LineSet]:

0 commit comments

Comments
 (0)