Skip to content

Commit 983e46d

Browse files
committed
gh-145846: Rename variables per reviewer feedback
- Rename 'c' to 'pContext' in clearEntries() loop for consistency - Rename 'p' to 'profiler' in test_clear_with_nested_calls()
1 parent 389e369 commit 983e46d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Lib/test/test_profiling/test_tracing_profiler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ def level2(profiler):
157157
def level1(profiler):
158158
level2(profiler)
159159

160-
p = _lsprof.Profiler()
161-
p.enable()
160+
profiler = _lsprof.Profiler()
161+
profiler.enable()
162162
for _ in range(100):
163-
level1(p)
164-
p.disable()
165-
p.clear()
163+
level1(profiler)
164+
profiler.disable()
165+
profiler.clear()
166166

167167
def test_bad_descriptor(self):
168168
# gh-132250

Modules/_lsprof.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ static void clearEntries(ProfilerObject *pObj)
293293
pObj->profilerEntries = EMPTY_ROTATING_TREE;
294294
/* release the memory hold by the ProfilerContexts */
295295
while (pObj->currentProfilerContext) {
296-
ProfilerContext *c = pObj->currentProfilerContext;
297-
pObj->currentProfilerContext = c->previous;
298-
PyMem_Free(c);
296+
ProfilerContext *pContext = pObj->currentProfilerContext;
297+
pObj->currentProfilerContext = pContext->previous;
298+
PyMem_Free(pContext);
299299
}
300300
while (pObj->freelistProfilerContext) {
301301
ProfilerContext *c = pObj->freelistProfilerContext;

0 commit comments

Comments
 (0)