[rt #68994] initialize the btm data structure more efficiently
authorTony Cook <tony@develop-help.com>
Sat, 15 Oct 2011 01:14:26 +0000 (12:14 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 15 Oct 2011 01:14:26 +0000 (12:14 +1100)
Changes
datatypes.c

diff --git a/Changes b/Changes
index 1e12836..1ab3dd4 100644 (file)
--- a/Changes
+++ b/Changes
@@ -46,6 +46,10 @@ Bug fixes:
    efficient.
    https://rt.cpan.org/Ticket/Display.html?id=69158
 
+ - the btm data structure used by the flood_fill code is now
+   initialized more efficiently.
+   https://rt.cpan.org/Ticket/Display.html?id=68994
+
 Imager 0.85_01 - 10 Oct 2011
 ==============
 
index c7b37b3..90b0b11 100644 (file)
@@ -22,7 +22,7 @@ btm_new(i_img_dim xsize,i_img_dim ysize) {
   btm->data=(char*)mymalloc(bytes); /* checked 4jul05 tonyc */
   btm->xsize=xsize;
   btm->ysize=ysize;
-  for(i=0;i<(xsize*ysize+8)/8;i++) btm->data[i]=0; /* Is this always needed */
+  memset(btm->data, 0, bytes);
   return btm;
 }