Paolo Bonzini <pbonz...@redhat.com> writes:

> test-visitor-serialization list tests is using an "if" to pick either the 
> first
> element of the list or the next one.  This was done presumably to mimic the
> code that creates the list, which has to fill in either the head pointer
> or the next pointer of the last element.  However, the code in the insert
> phase is a pretty standard singly-linked list insertion, while the one
> in the visit phase looks weird and even looks at the first item twice:
> this is confusing because the test puts in 32 items and finishes with
> an assertion that i == 33.
>
> So, move the "else" step in a separate switch statement, and change
> the do...while loop to a while, because cur_head has already been
> initialized beforehand.
>
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>

Still a rather smelly bowl of copy-pasta, but this is incremental
improvement, so:
Reviewed-by: Markus Armbruster <arm...@redhat.com>


Reply via email to