Fixed duplicated condition (#2553)

The condition `if(node->prev)` was checked in the previous:
`if( node->prev && n > 5 ) {`
This commit is contained in:
Roman Kalashnikov 2017-10-29 13:00:59 +03:00 committed by Lemongrass3110
parent 618e668bdf
commit 9772639ae7

View File

@ -2920,7 +2920,7 @@ void* linkdb_search( struct linkdb_node** head, void *key)
if( node->key == key ) { if( node->key == key ) {
if( node->prev && n > 5 ) { if( node->prev && n > 5 ) {
//Moving the head in order to improve processing efficiency //Moving the head in order to improve processing efficiency
if(node->prev) node->prev->next = node->next; node->prev->next = node->next;
if(node->next) node->next->prev = node->prev; if(node->next) node->next->prev = node->prev;
node->next = *head; node->next = *head;
node->prev = (*head)->prev; node->prev = (*head)->prev;