]> git.sur5r.net Git - cc65/commitdiff
Grow the Span collection before adding spans for the segments. This means that
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 12 Aug 2011 16:10:34 +0000 (16:10 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 12 Aug 2011 16:10:34 +0000 (16:10 +0000)
in most cases the colection will have the optimal size.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5157 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/span.c

index 47db633b0b878e7a0fffaa4bb03a81c147e67403..69d44ca45489a32758a18a13f25c0d7112c4735b 100644 (file)
@@ -90,6 +90,9 @@ void OpenSpans (Collection* Spans)
 {
     unsigned I;
 
+    /* Grow the Spans collection as necessary */
+    CollGrow (Spans, CollCount (&SegmentList));
+
     /* Add the currently active segment */
     CollAppend (Spans, NewSpan (ActiveSeg, ActiveSeg->PC, ActiveSeg->PC));