forked from len0rd/rockbox
Replace arrays of tags that are numeric/sorted/uniqued with bitfields flagging each tag that is a member of the set, and replace the membership tests with a shift and bitwise and. The test is still done inside a function on SH, as this saves some space vs the macro used on other targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21175 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2bedde17b6
commit
1248a0dc1f
3 changed files with 72 additions and 77 deletions
|
|
@ -329,7 +329,7 @@ static bool read_clause(struct tagcache_search_clause *clause)
|
|||
strcpy(clause->str, buf);
|
||||
}
|
||||
|
||||
if (tagcache_is_numeric_tag(clause->tag))
|
||||
if (TAGCACHE_IS_NUMERIC(clause->tag))
|
||||
{
|
||||
clause->numeric = true;
|
||||
clause->numeric_data = atoi(clause->str);
|
||||
|
|
@ -1086,12 +1086,12 @@ static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
|
|||
/* Prevent duplicate entries in the search list. */
|
||||
tagcache_search_set_uniqbuf(tcs, uniqbuf, UNIQBUF_SIZE);
|
||||
|
||||
if (level || csi->clause_count[0] || tagcache_is_numeric_tag(tag))
|
||||
if (level || csi->clause_count[0] || TAGCACHE_IS_NUMERIC(tag))
|
||||
sort = true;
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
{
|
||||
if (tagcache_is_numeric_tag(csi->tagorder[i]))
|
||||
if (TAGCACHE_IS_NUMERIC(csi->tagorder[i]))
|
||||
{
|
||||
static struct tagcache_search_clause cc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue