emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CHAR_TO_BYTE in bidi_resolve_explicit_1


From: Eli Zaretskii
Subject: Re: CHAR_TO_BYTE in bidi_resolve_explicit_1
Date: Tue, 05 Mar 2013 05:51:33 +0200

> Date: Tue, 05 Mar 2013 06:05:44 +0400
> From: Dmitry Antipov <address@hidden>
> CC: Emacs development discussions <address@hidden>
> 
> I suspect that this call to CHAR_TO_BYTE in bidi_resolve_explicit_1
> is redundant; can you check that?

We could use BEGV_BYTE when we limit charpos to BEGV, yes.  But
otherwise, the call to CHAR_TO_BYTE is not redundant, because nothing
else makes sure bidi_it->charpos is synchronized with bidi_it->bytepos
when the display engine re-seats the display iterator.

Did you see some evidence that the call to CHAR_TO_BYTE is redundant
in the general case?  The case of before BEGV is quite rare, so
eliminating CHAR_TO_BYTE there won't give you any speed up, and
CHAR_TO_BYTE is fast at BEGV anyway.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]