On Thu, Nov 19, 2009 at 4:44 PM, Paul Phillips <pa...@improving.org> wrote:

> On Thu, Nov 19, 2009 at 04:31:39PM -0800, David Pollak wrote:
> > I spent most of today tracking down a bug that I can't reproduce in
> > isolation, but it seems that the ensureCapacity method in Scala's
> > StringBuilder method has an infinite:
>
> Yeah, it was pretty obvious knowing it was there.  This will show it:
>
>  new StringBuilder(0, "").ensureCapacity(1)
>
> Because:
>
>      while (n > newsize)
>        newsize = newsize * 2
>
> And um 0 * 2 == 0
>

Nice


>
> --
> Paul Phillips      | Simplicity and elegance are unpopular because
> Stickler           | they require hard work and discipline to achieve
> Empiricist         | and education to be appreciated.
> i pull his palp!   |     -- Dijkstra
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.


Reply via email to