aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-04 23:09:14 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-04 23:09:14 +1000
commit4f947015d25028db5b5f161d85bfd563a226c927 (patch)
treef197446387a2f3de57feb00e35bc6f1d78080916 /util.c
parent9f3a7543aa4442fedf56ff94150d38199e194cf4 (diff)
Minor tweaks, including a few small performance improvements
darcs-hash:20060204130914-ac50b-331e83fd8fe472545fce60fc4b76bb8300526d64.gz
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util.c b/util.c
index 1cc2a44f..5e95960c 100644
--- a/util.c
+++ b/util.c
@@ -511,6 +511,20 @@ int hash_wcs_cmp( const void *a, const void *b )
return wcscmp((wchar_t *)a,(wchar_t *)b) == 0;
}
+int hash_ptr_func( const void *data )
+{
+ return (int)(long) data;
+}
+
+/**
+ Hash comparison function suitable for direct pointer comparison
+*/
+int hash_ptr_cmp( const void *a,
+ const void *b )
+{
+ return a == b;
+}
+
void pq_init( priority_queue_t *q,
int (*compare)(void *e1, void *e2) )
{