diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-15 08:26:36 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-15 08:26:36 -0400 |
commit | db235732dd9a0198f6e5d00b895baa516221fee2 (patch) | |
tree | 478b50037f9fdbef2fc570c3dbad899987518bfa /coverage/ctracer/tracer.h | |
parent | f6d3e88ba5b2dab1720281885c99cdf3ce2844bc (diff) | |
download | python-coveragepy-git-db235732dd9a0198f6e5d00b895baa516221fee2.tar.gz |
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.
Diffstat (limited to 'coverage/ctracer/tracer.h')
-rw-r--r-- | coverage/ctracer/tracer.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/coverage/ctracer/tracer.h b/coverage/ctracer/tracer.h index 8994a9e3..fbbfa202 100644 --- a/coverage/ctracer/tracer.h +++ b/coverage/ctracer/tracer.h @@ -39,15 +39,14 @@ typedef struct CTracer { PyObject * context; /* - The data stack is a stack of dictionaries. Each dictionary collects + The data stack is a stack of sets. Each set collects data for a single source file. The data stack parallels the call stack: each call pushes the new frame's file data onto the data stack, and each return pops file data off. - The file data is a dictionary whose form depends on the tracing options. - If tracing arcs, the keys are line number pairs. If not tracing arcs, - the keys are line numbers. In both cases, the value is irrelevant - (None). + The file data is a set whose form depends on the tracing options. + If tracing arcs, the values are line number pairs. If not tracing arcs, + the values are line numbers. */ DataStack data_stack; /* Used if we aren't doing concurrency. */ |