| 411 | |
| 412 | |
| 413 | void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2) |
| 414 | { |
| 415 | my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; |
| 416 | uint len= no_words_in_map(map), len2 = no_words_in_map(map2); |
| 417 | |
| 418 | DBUG_ASSERT(map->bitmap && map2->bitmap); |
| 419 | |
| 420 | end= to + MY_MIN(len, len2); |
| 421 | for (; to < end; to++, from++) |
| 422 | *to &= *from; |
| 423 | |
| 424 | if (len >= len2) |
| 425 | map->bitmap[len2 - 1] &= ~map2->last_word_mask; |
| 426 | |
| 427 | if (len2 < len) |
| 428 | { |
| 429 | end+=len-len2; |
| 430 | for (; to < end; to++) |
| 431 | *to= 0; |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | |
| 436 | /* |