summaryrefslogtreecommitdiff
path: root/coverage/data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-11 20:17:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-11 20:17:24 -0400
commitd93e5d5da230876e946aa94f59e706d3b798c62b (patch)
treee243592dfb6c30e766ae4363472d788effd00583 /coverage/data.py
parent064f6f18ea75af5f28a9adf959e902f6c3010bb6 (diff)
downloadpython-coveragepy-git-d93e5d5da230876e946aa94f59e706d3b798c62b.tar.gz
Reduce the amount of data translation by having the tracers record data in a form more like it will be consumed. Also should reduce the amount of work the tracers have to do.
Diffstat (limited to 'coverage/data.py')
-rw-r--r--coverage/data.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/data.py b/coverage/data.py
index 28925f54..fd6256e1 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -147,14 +147,14 @@ class CoverageData:
for filename, file_data in new_lines.items():
self.lines.setdefault(filename, {}).update(file_data)
- def add_line_data(self, data_points):
+ def add_line_data(self, line_data):
"""Add executed line data.
- `data_points` is (filename, lineno) pairs.
+ `line_data` is { filename: { lineno: True, ... }, ...}
"""
- for filename, lineno in data_points:
- self.lines.setdefault(filename, {})[lineno] = True
+ for filename, linenos in line_data.items():
+ self.lines.setdefault(filename, {}).update(linenos)
def add_arc_data(self, arc_data):
for filename, arc in arc_data: