Skip to content

Commit 46b6870

Browse files
committed
gc_alloc: Remove redundant 'collected' assignment
The remaining assignment was added in upstream micropython; the deleted assignment was added in circuitpython as part of the long-lived object area feature. During the merge, the redundant assignment was not removed. (since collected is a local variable and no pointers to it escape, it doesn't seem possible for the placement of the assignment before or after GC_ENTER() is important) This diagnostic was found by clang 7's scan-build static analyzer.
1 parent 0d96f19 commit 46b6870

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

py/gc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) {
509509
gc_collect();
510510
collected = 1;
511511
GC_ENTER();
512-
collected = true;
513512
}
514513
#endif
515514

0 commit comments

Comments
 (0)