Only alloc if necessary. Patch by Jonathan Gordon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30716 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a604345ae1
commit
725ed0ad3f
|
@ -594,10 +594,13 @@ struct font* font_get(int font)
|
|||
return &sysfont;
|
||||
|
||||
while (1) {
|
||||
struct buflib_alloc_data *alloc = core_get_data(buflib_allocations[font]);
|
||||
pf = &alloc->font;
|
||||
if (pf && pf->height)
|
||||
return pf;
|
||||
if (buflib_allocations[font] > 0)
|
||||
{
|
||||
struct buflib_alloc_data *alloc = core_get_data(buflib_allocations[font]);
|
||||
pf = &alloc->font;
|
||||
if (pf && pf->height)
|
||||
return pf;
|
||||
}
|
||||
if (--font < 0)
|
||||
return &sysfont;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue