MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / bitmap_intersect

Function bitmap_intersect

mysys/my_bitmap.c:413–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411
412
413void 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/*

Callers 1

intersectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected