summaryrefslogtreecommitdiff
path: root/sql/sql_bitmap.h
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-06-04 19:26:35 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2005-06-04 19:26:35 +0200
commit84f89641cfc6acff016b973c3bfa12ef0a31fe12 (patch)
tree5a32b384f0388487fb7fee12035b2f2e36fb75d9 /sql/sql_bitmap.h
parent7b3cd08e9bb71e57102a5aa5ab2237980bf92b02 (diff)
parentdab1b26b1d3ec57e11681459282de2fe81e362f3 (diff)
downloadmariadb-git-84f89641cfc6acff016b973c3bfa12ef0a31fe12.tar.gz
Merge
BitKeeper/etc/logging_ok: auto-union libmysqld/Makefile.am: Auto merged sql/field.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/item.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged sql/sql_bitmap.h: merge
Diffstat (limited to 'sql/sql_bitmap.h')
-rw-r--r--sql/sql_bitmap.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h
index bd137e15b90..5e5bb1d8d3b 100644
--- a/sql/sql_bitmap.h
+++ b/sql/sql_bitmap.h
@@ -28,7 +28,7 @@ template <uint default_width> class Bitmap
uint32 buffer[(default_width+31)/32];
public:
Bitmap() { init(); }
- Bitmap(Bitmap& from) { *this=from; }
+ Bitmap(const Bitmap& from) { *this=from; }
explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); }
void init() { bitmap_init(&map, buffer, default_width, 0); }
void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); }
@@ -61,19 +61,17 @@ public:
my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
char *print(char *buf) const
{
- char *s=buf; int i;
- uchar *uchar_buffer= (uchar*)&buffer;
- for (i=sizeof(buffer)-1; i>=0 ; i--)
+ char *s=buf;
+ const uchar *e=buffer, *b=e+sizeof(buffer)-1;
+ while (!*b && b>e)
+ b--;
+ if ((*s=_dig_vec_upper[*b >> 4]) != '0')
+ s++;
+ *s++=_dig_vec_upper[*b & 15];
+ while (--b>=e)
{
- if ((*s=_dig_vec_upper[uchar_buffer[i] >> 4]) != '0')
- break;
- if ((*s=_dig_vec_upper[uchar_buffer[i] & 15]) != '0')
- break;
- }
- for (s++, i-- ; i>=0 ; i--)
- {
- *s++=_dig_vec_upper[uchar_buffer[i] >> 4];
- *s++=_dig_vec_upper[uchar_buffer[i] & 15];
+ *s++=_dig_vec_upper[*b >> 4];
+ *s++=_dig_vec_upper[*b & 15];
}
*s=0;
return buf;