From db235732dd9a0198f6e5d00b895baa516221fee2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 15 Aug 2021 08:26:36 -0400 Subject: refactor: use sets to collect data Coverage.py predates sets as a built-in data structure, so the file data collection has long been dicts with None as the values. Sets are available to us now (since Python 2.4 in 2004, which coverage.py dropped support for in 2014!), we use sets. --- coverage/sqldata.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'coverage/sqldata.py') diff --git a/coverage/sqldata.py b/coverage/sqldata.py index db3ab73a..3fe5317e 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -450,9 +450,9 @@ class CoverageData(SimpleReprMixin): def add_lines(self, line_data): """Add measured line data. - `line_data` is a dictionary mapping file names to dictionaries:: + `line_data` is a dictionary mapping file names to iterables of ints:: - { filename: { lineno: None, ... }, ...} + { filename: { line1, line2, ... }, ...} """ if self._debug.should('dataop'): @@ -483,9 +483,10 @@ class CoverageData(SimpleReprMixin): def add_arcs(self, arc_data): """Add measured arc data. - `arc_data` is a dictionary mapping file names to dictionaries:: + `arc_data` is a dictionary mapping file names to iterables of pairs of + ints:: - { filename: { (l1,l2): None, ... }, ...} + { filename: { (l1,l2), (l1,l2), ... }, ...} """ if self._debug.should('dataop'): -- cgit v1.2.1