INLINE Lisp_Object
CHAR_TABLE_REF_ASCII (Lisp_Object ct, ptrdiff_t idx)
{
- struct Lisp_Char_Table *tbl = NULL;
- Lisp_Object val;
- do
+ for (struct Lisp_Char_Table *tbl = XCHAR_TABLE (ct); ;
+ tbl = XCHAR_TABLE (tbl->parent))
{
- tbl = tbl ? XCHAR_TABLE (tbl->parent) : XCHAR_TABLE (ct);
- val = (! SUB_CHAR_TABLE_P (tbl->ascii) ? tbl->ascii
- : XSUB_CHAR_TABLE (tbl->ascii)->contents[idx]);
+ Lisp_Object val = (SUB_CHAR_TABLE_P (tbl->ascii)
+ ? XSUB_CHAR_TABLE (tbl->ascii)->contents[idx]
+ : tbl->ascii);
if (NILP (val))
val = tbl->defalt;
+ if (!NILP (val) || NILP (tbl->parent))
+ return val;
}
- while (NILP (val) && ! NILP (tbl->parent));
-
- return val;
}
/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII