mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 09:32:02 +00:00
Speedup SF2 loading by using prepend instead of append on samples
Using prepend both in sffile and defsfont reduces insert complexity to O(1) and does not affect the final order of the sample list, as the reversed order of the samples in sffile is reversed again in defsfont.
This commit is contained in:
parent
0f8e2c7fde
commit
5ebd4d3d26
2 changed files with 2 additions and 2 deletions
|
@ -562,7 +562,7 @@ err_exit:
|
|||
*/
|
||||
int fluid_defsfont_add_sample(fluid_defsfont_t *defsfont, fluid_sample_t *sample)
|
||||
{
|
||||
defsfont->sample = fluid_list_append(defsfont->sample, sample);
|
||||
defsfont->sample = fluid_list_prepend(defsfont->sample, sample);
|
||||
return FLUID_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -2024,7 +2024,7 @@ static int load_shdr(SFData *sf, unsigned int size)
|
|||
}
|
||||
p->idx = i;
|
||||
|
||||
sf->sample = fluid_list_append(sf->sample, p);
|
||||
sf->sample = fluid_list_prepend(sf->sample, p);
|
||||
READSTR(sf, &p->name);
|
||||
READD(sf, p->start);
|
||||
READD(sf, p->end);
|
||||
|
|
Loading…
Reference in a new issue