scanner: prioritize databases with recent matches
This should improve performance when scanning many files in a row that all match against the same database, which is the expectation.
This commit is contained in:
parent
b668193923
commit
bedf65e72e
|
@ -868,6 +868,17 @@ static int database_info_list_iterate_found_match(
|
||||||
free(db_playlist_base_str);
|
free(db_playlist_base_str);
|
||||||
free(db_crc);
|
free(db_crc);
|
||||||
|
|
||||||
|
/* Move database to start since we are likely to match against it
|
||||||
|
again */
|
||||||
|
if (db_state->list_index != 0)
|
||||||
|
{
|
||||||
|
struct string_list_elem entry = db_state->list->elems[db_state->list_index];
|
||||||
|
memmove(&db_state->list->elems[1],
|
||||||
|
&db_state->list->elems[0],
|
||||||
|
sizeof(entry) * db_state->list_index);
|
||||||
|
db_state->list->elems[0] = entry;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue