summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-22 00:22:42 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-03-22 00:22:42 -0400
commit61bc7b91bc7bf904d196b132e9e862e059780783 (patch)
tree29abfc66b5b8c22d081e95efed4ca97f0e6daffc
parentcfeeb7889d5346e2abaf9b198375df62c58b098f (diff)
downloadrockbox-61bc7b91bc.tar.gz
rockbox-61bc7b91bc.zip
tagcache.c remove 16-bit compression for add_uniqbuf
apparently there are tags such as year or genre that are indexed 1 byte apart, as much as I like the idea of this I cannot come up with a way to reliably denote 2 16 bit entries from a single 32 bit entry without losing data or adding bookkeeping which would likely make it pointless Change-Id: I8a9908575700cab9506c36f5422222145557fa6b
-rw-r--r--apps/tagcache.c49
1 files changed, 5 insertions, 44 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index f49a67924e..8bc742112b 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -1284,52 +1284,13 @@ static bool add_uniqbuf(struct tagcache_search *tcs, uint32_t id)
return true;
}
- if (id <= UINT16_MAX)
- {
- /* place two 16-bit entries in a single 32-bit slot */
- uint32_t idtmp;
- union uentry{
- uint16_t u16[2];
- uint32_t u32;
- } *entry;
- id |= 1; /*odd - flag 16-bit entry */
- for (i = 0; i < tcs->unique_list_count; i++)
- {
- entry = (union uentry *) &tcs->unique_list[i];
- if ((entry->u32 & 1) == 0) /* contains a 32-bit entry */
- continue;
-
- /* Return false if entry is found. */
- if (entry->u16[0] == id || entry->u16[1] == id)
- {
- //logf("%d Exists (16) @ %d", id, i);
- return false;
- }
-
- if (entry->u16[1] == 0 && (entry->u16[0] & 1) == 1)
- {
- entry->u16[1] = id & UINT16_MAX;
- return true; /*no more 16bit entries add to empty 16bit slot */
- }
-
- }
- /* Not Found and no empty slot add a new entry */
- entry = (union uentry *) &idtmp;
- entry->u16[1] = 0;
- entry->u16[0] = id & UINT16_MAX;
- id = idtmp;
- }
- else
+ for (i = 0; i < tcs->unique_list_count; i++)
{
- id &= ~1; /* even - flag 32-bit entry */
- for (i = 0; i < tcs->unique_list_count; i++)
+ /* Return false if entry is found. */
+ if (tcs->unique_list[i] == id)
{
- /* Return false if entry is found. */
- if (tcs->unique_list[i] == id)
- {
- //logf("%d Exists (32)@ %d", id, i);
- return false;
- }
+ //logf("%d Exists @ %d", id, i);
+ return false;
}
}