unsigned char *ti, *si, *end;
ti = t->map;
si = s->map;
- end = ti + t->size;
+ end = ti + (t->size < s->size ? t->size : s->size);
while (ti < end)
*ti++ &= *si++;
}
-/* like map_and but negates value in s first, i.e. t & ~s */
+/* remove all set bits in s from t. */
void
-map_and_not(Map *t, Map *s)
+map_subtract(Map *t, Map *s)
{
unsigned char *ti, *si, *end;
ti = t->map;
si = s->map;
- end = ti + t->size;
+ end = ti + (t->size < s->size ? t->size : s->size);
while (ti < end)
*ti++ &= ~*si++;
}
extern void map_grow(Map *m, int n);
extern void map_free(Map *m);
extern void map_and(Map *t, Map *s);
-extern void map_and_not(Map *t, Map *s);
+extern void map_subtract(Map *t, Map *s);
static inline void map_empty(Map *m)
{