~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key_map.cc

  • Committer: Monty Taylor
  • Date: 2009-05-08 19:07:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090508190739-rwas5y9xjg1a92p6
Reverted a crap-ton of padraig's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <drizzled/key_map.h>
23
23
 
24
 
bool is_keymap_prefix(const key_map& map, const uint32_t prefix_size)
 
24
bool is_subset(const key_map& map, const key_map& map2)
 
25
{
 
26
 
 
27
  size_t count;
 
28
  for (count= 0; count < map.size(); count++)
 
29
  {
 
30
    if (map[count] & ~map2[count])
 
31
      return true;
 
32
  }
 
33
  return false;
 
34
 
 
35
}
 
36
 
 
37
bool is_prefix(const key_map& map, const uint32_t prefix_size)
25
38
{
26
39
  size_t pos= 0;
27
40
 
28
41
  for (; pos < prefix_size; pos++)
29
 
    if (! map.test(pos))
 
42
    if (map[pos] == false)
30
43
      return false;
31
44
 
32
45
  /*TODO: huh?
36
49
  */
37
50
 
38
51
  for (; pos < map.size(); pos++)
39
 
    if (map.test(pos))
 
52
    if (map[pos] == true)
40
53
      return false;
41
54
 
42
55
  return true;
43
56
}
44
57
 
45
 
void set_prefix(key_map& map, const uint32_t prefix_size)
46
 
{
47
 
  size_t pos= 0;
48
 
 
49
 
  for (; pos < prefix_size && pos < map.size(); pos++)
50
 
  {
51
 
    map.set(pos);
52
 
  }
53
 
}
54
 
 
55
58
bool is_overlapping(const key_map& map, const key_map& map2)
56
59
{
57
60
  size_t count;
62
65
  }
63
66
  return true;
64
67
}
65
 
 
66
 
void key_map_subtract(key_map& map1, key_map& map2)
67
 
{
68
 
  map1&= map2.flip();
69
 
  map2.flip();
70
 
}