help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: indent-region for long Java strings very slow


From: David Hansen
Subject: Re: indent-region for long Java strings very slow
Date: Thu, 26 Oct 2006 17:06:33 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On 26 Oct 2006 07:15:17 -0700 "address@hidden" <address@hidden> wrote:

> When I build a very long Java String with lots of components (... + ...
> + ... +), spread out over many lines (each terminated by a newline),
> indent-region gets very, very slow.

Not emacs related:  AFAIK javac creates a new StringBuffer
object for *each* `+'.  So if you don't want your program to
be unnecessarily slow do something like

String foo = (new StringBuffer ()).append (...)
  .append (...)
  .append (...)
  // ...
  .toString ();

David





reply via email to

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