From 77009b45a8ce878e8739df5d49c62caa27ba6aa1 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 8 Apr 2019 20:36:00 -0400 Subject: Oops, clean up some unused listcomps --- coverage/sqldata.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'coverage') diff --git a/coverage/sqldata.py b/coverage/sqldata.py index 09d647e5..5ae99c7e 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -438,27 +438,26 @@ class CoverageSqliteData(SimpleReprMixin): # Prepare arc and line rows to be inserted by converting the file # and context strings with integer ids. Then use the efficient # `executemany()` to insert all rows at once. - arc_rows = [ + arc_rows = ( (file_ids[file], context_ids[context], fromno, tono) for file, context, fromno, tono in arcs - ] - line_rows = [ + ) + line_rows = ( (file_ids[file], context_ids[context], lineno) for file, context, lineno in lines - ] + ) self._choose_lines_or_arcs(arcs=bool(arcs), lines=bool(lines)) conn.executemany( 'insert or ignore into arc ' '(file_id, context_id, fromno, tono) values (?, ?, ?, ?)', - ((file_ids[file], context_ids[context], fromno, tono) - for file, context, fromno, tono in arcs) + arc_rows ) conn.executemany( 'insert or ignore into line ' '(file_id, context_id, lineno) values (?, ?, ?)', - ((file_ids[file], context_ids[context], lineno) for file, context, lineno in lines) + line_rows ) conn.executemany( 'insert or ignore into tracer (file_id, tracer) values (?, ?)', -- cgit v1.2.1