[mapserver-commits] r7538 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Apr 27 03:14:41 EDT 2008
Author: pramsey
Date: 2008-04-27 03:14:40 -0400 (Sun, 27 Apr 2008)
New Revision: 7538
Modified:
trunk/mapserver/mapbits.c
Log:
And now tighten up the implementation, because I'm too dumb to stop.
Modified: trunk/mapserver/mapbits.c
===================================================================
--- trunk/mapserver/mapbits.c 2008-04-27 06:33:50 UTC (rev 7537)
+++ trunk/mapserver/mapbits.c 2008-04-27 07:14:40 UTC (rev 7538)
@@ -62,9 +62,13 @@
*/
int msGetNextBit(char *array, int i, int size) {
+ char b;
+
while(i < size) {
- if( (i % CHAR_BIT) || *(array + (i/CHAR_BIT)) ) {
+ b = *(array + (i/CHAR_BIT));
+ if( b && (b >> (i % CHAR_BIT)) ) {
/* There is something in this byte */
+ /* And it is not to the right of us */
if( msGetBit( array, i ) ) {
return i;
}
@@ -73,8 +77,8 @@
}
}
else {
- /* Nothing in this byte, move on */
- i += CHAR_BIT;
+ /* Nothing in this byte, move to start of next byte */
+ i += CHAR_BIT - (i % CHAR_BIT);
}
}
More information about the mapserver-commits
mailing list