Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/nodes/bitmapset.c23
-rw-r--r--src/backend/utils/hash/hashfn.c24
2 files changed, 23 insertions, 24 deletions
diff --git a/src/backend/nodes/bitmapset.c b/src/backend/nodes/bitmapset.c
index 648cc1a7eb3..f711e6c6995 100644
--- a/src/backend/nodes/bitmapset.c
+++ b/src/backend/nodes/bitmapset.c
@@ -1167,3 +1167,26 @@ bms_hash_value(const Bitmapset *a)
return DatumGetUInt32(hash_any((const unsigned char *) a->words,
(lastword + 1) * sizeof(bitmapword)));
}
+
+/*
+ * bitmap_hash - hash function for keys that are (pointers to) Bitmapsets
+ *
+ * Note: don't forget to specify bitmap_match as the match function!
+ */
+uint32
+bitmap_hash(const void *key, Size keysize)
+{
+ Assert(keysize == sizeof(Bitmapset *));
+ return bms_hash_value(*((const Bitmapset *const *) key));
+}
+
+/*
+ * bitmap_match - match function to use with bitmap_hash
+ */
+int
+bitmap_match(const void *key1, const void *key2, Size keysize)
+{
+ Assert(keysize == sizeof(Bitmapset *));
+ return !bms_equal(*((const Bitmapset *const *) key1),
+ *((const Bitmapset *const *) key2));
+}
diff --git a/src/backend/utils/hash/hashfn.c b/src/backend/utils/hash/hashfn.c
index dc3cbac7ef7..fa46c59d254 100644
--- a/src/backend/utils/hash/hashfn.c
+++ b/src/backend/utils/hash/hashfn.c
@@ -23,7 +23,6 @@
#include "postgres.h"
#include "fmgr.h"
-#include "nodes/bitmapset.h"
#include "utils/hashutils.h"
#include "utils/hsearch.h"
@@ -695,26 +694,3 @@ uint32_hash(const void *key, Size keysize)
Assert(keysize == sizeof(uint32));
return DatumGetUInt32(hash_uint32(*((const uint32 *) key)));
}
-
-/*
- * bitmap_hash: hash function for keys that are (pointers to) Bitmapsets
- *
- * Note: don't forget to specify bitmap_match as the match function!
- */
-uint32
-bitmap_hash(const void *key, Size keysize)
-{
- Assert(keysize == sizeof(Bitmapset *));
- return bms_hash_value(*((const Bitmapset *const *) key));
-}
-
-/*
- * bitmap_match: match function to use with bitmap_hash
- */
-int
-bitmap_match(const void *key1, const void *key2, Size keysize)
-{
- Assert(keysize == sizeof(Bitmapset *));
- return !bms_equal(*((const Bitmapset *const *) key1),
- *((const Bitmapset *const *) key2));
-}