[instancer/varstore] Remove sorting from the optimizer

Just work with incoming order.
This commit is contained in:
Behdad Esfahbod committed 2025-09-12 19:19:07 -06:00
1 parent e16be51549
commit a878dca00f
2 files changed
-21

No files matched your search

-16
View File
@@ -2386,11 +2386,6 @@ struct delta_row_encoding_t
return cols;
}
int cmp (const chars_t& other) const
{
return as_array ().cmp (other.as_array ());
}
hb_pair_t<unsigned, unsigned> get_width ()
{
unsigned width = 0;
@@ -2485,17 +2480,6 @@ struct delta_row_encoding_t
return combined_gain;
}
static int cmp (const void *pa, const void *pb)
{
const delta_row_encoding_t *a = (const delta_row_encoding_t *)pa;
const delta_row_encoding_t *b = (const delta_row_encoding_t *)pb;
if (a->width != b->width)
return (int) a->width - (int) b->width;
return b->chars.cmp (a->chars);
}
bool add_row (const hb_vector_t<int>* row)
{ return items.push (row); }
};
-5
View File
@@ -1877,8 +1877,6 @@ struct item_variations_t
* is a compromise between optimization and performance and practically
* works very well. */
/* sort encoding_objs */
encoding_objs.qsort ();
/* main algorithm: repeatedly pick 2 best encodings to combine, and combine them */
using item_t = hb_priority_queue_t<combined_gain_idx_tuple_t>::item_t;
@@ -1953,9 +1951,6 @@ struct item_variations_t
encodings.push (std::move (encoding_objs.arrayZ[i]));
}
/* sort again based on width, make result deterministic */
encodings.qsort ();
return compile_varidx_map (front_mapping);
}