forked from enlightenment/terminology
terminology: let the compiler inline more agressively the common case for a 1% win.
This commit is contained in:
parent
c1b516f231
commit
433b18b211
|
@ -1429,15 +1429,12 @@ termpty_block_chid_get(Termpty *ty, const char *chid)
|
||||||
return tb;
|
return tb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_handle_block_codepoint_overwrite_heavy(Termpty *ty, int oldc, int newc)
|
||||||
static inline void
|
|
||||||
_handle_block_codepoint_overwrite(Termpty *ty, int oldc, int newc)
|
|
||||||
{
|
{
|
||||||
Termblock *tb;
|
Termblock *tb;
|
||||||
int ido = 0, idn = 0;
|
int ido = 0, idn = 0;
|
||||||
|
|
||||||
if (!((oldc | newc) & 0x80000000)) return;
|
|
||||||
if (oldc & 0x80000000) ido = (oldc >> 18) & 0x1fff;
|
if (oldc & 0x80000000) ido = (oldc >> 18) & 0x1fff;
|
||||||
if (newc & 0x80000000) idn = (newc >> 18) & 0x1fff;
|
if (newc & 0x80000000) idn = (newc >> 18) & 0x1fff;
|
||||||
if (((oldc & 0x80000000) && (newc & 0x80000000)) && (idn == ido)) return;
|
if (((oldc & 0x80000000) && (newc & 0x80000000)) && (idn == ido)) return;
|
||||||
|
@ -1463,6 +1460,14 @@ _handle_block_codepoint_overwrite(Termpty *ty, int oldc, int newc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Try to trick the compiler into inlining the first test */
|
||||||
|
static inline void
|
||||||
|
_handle_block_codepoint_overwrite(Termpty *ty, int oldc, int newc)
|
||||||
|
{
|
||||||
|
if (!((oldc | newc) & 0x80000000)) return;
|
||||||
|
_handle_block_codepoint_overwrite_heavy(ty, oldc, newc);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
termpty_cell_copy(Termpty *ty, Termcell *src, Termcell *dst, int n)
|
termpty_cell_copy(Termpty *ty, Termcell *src, Termcell *dst, int n)
|
||||||
{
|
{
|
||||||
|
@ -1515,13 +1520,13 @@ termpty_cell_fill(Termpty *ty, Termcell *src, Termcell *dst, int n)
|
||||||
void
|
void
|
||||||
termpty_cell_codepoint_att_fill(Termpty *ty, int codepoint, Termatt att, Termcell *dst, int n)
|
termpty_cell_codepoint_att_fill(Termpty *ty, int codepoint, Termatt att, Termcell *dst, int n)
|
||||||
{
|
{
|
||||||
|
Termcell local = { codepoint, att };
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
_handle_block_codepoint_overwrite(ty, dst[i].codepoint, codepoint);
|
_handle_block_codepoint_overwrite(ty, dst[i].codepoint, codepoint);
|
||||||
dst[i].codepoint = codepoint;
|
dst[i] = local;
|
||||||
dst[i].att = att;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue