In article <[EMAIL PROTECTED]>, "Richard M. Stallman" <[EMAIL PROTECTED]> 
writes:

>>  I think that the cleanest thing to do, in loops that don't need to be
>>  as fast as possible, is avoid saving addresses of string data at all.

>     I agree.  But, I think display_mode_element is the place
>     that have to be as fast as possible.

> I would think that it doesn't take up very much of Emacs cpu time,
> and that a small slowdown there would be insignificant.  That function
> calls subroutines that do a lot of work.

> Looking at the new code, I think it is correct.  It is correct because
> the code consists of many alternatives, and each one does only a
> single nontrivial thing and then gets to the end, where lisp_string
> and this are updated.  But it seems a bit fragile to me.
> What if some branch is later changed to do two things that could
> relocate?  Then it would have a bug again.

> So I think I will still put in the change I made.

I agree that your change is cleaner, and if the performance
won't be harmed that much, it is better to use your change
except for this kind of part:

!           while ((c = SREF (elt, offset++)) != '\0' && c != '%')

Isn't it better to avoid using something like "offset++" as
an argument of a macro even if we know that it's currently
safe.

---
Kenichi Handa
[EMAIL PROTECTED]


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to