mirror of
https://github.com/adulau/aha.git
synced 2024-12-26 10:46:11 +00:00
lib: fix sparse shadowed variable warning
pos is always set before being used, no need to declare a second one inside the if() block. lib/prio_heap.c:34:7: warning: symbol 'pos' shadows an earlier one lib/prio_heap.c:30:6: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
60348802e9
commit
40bc1f2dbc
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ void *heap_insert(struct ptr_heap *heap, void *p)
|
|||
|
||||
if (heap->size < heap->max) {
|
||||
/* Heap insertion */
|
||||
int pos = heap->size++;
|
||||
pos = heap->size++;
|
||||
while (pos > 0 && heap->gt(p, ptrs[(pos-1)/2])) {
|
||||
ptrs[pos] = ptrs[(pos-1)/2];
|
||||
pos = (pos-1)/2;
|
||||
|
|
Loading…
Reference in a new issue