summaryrefslogtreecommitdiff
path: root/src/search.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-03-14 11:01:01 +0000
committerBruno Haible <bruno@clisp.org>2003-03-14 11:01:01 +0000
commit7a8b43182a9e171bbd307466dde6b5c7878135f4 (patch)
tree3a7f41281fe9963b12196c521e54a1a814b3a973 /src/search.h
parent19c69d8e5a9151d25938eb06244978eb753995e8 (diff)
downloadgperf-7a8b43182a9e171bbd307466dde6b5c7878135f4.tar.gz
Optimized choice during collision resolution.
Diffstat (limited to 'src/search.h')
-rw-r--r--src/search.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/search.h b/src/search.h
index aefcd08..928c615 100644
--- a/src/search.h
+++ b/src/search.h
@@ -90,8 +90,15 @@ private:
and stores it in keyword->_hash_value. */
int compute_hash (KeywordExt *keyword) const;
+ /* Computes the frequency of occurrence of a character among the keywords
+ up to the given keyword. */
+ unsigned int compute_occurrence (unsigned int c, KeywordExt *curr) const;
+
/* Sorts the given set in increasing frequency of _occurrences[]. */
- void sort_by_occurrence (unsigned int *set, int len) const;
+ void sort_by_occurrence (unsigned int *set, unsigned int len) const;
+ /* Sorts the given set in increasing frequency of occurrences among the
+ keywords up to the given keyword. */
+ void sort_by_occurrence (unsigned int *set, unsigned int len, KeywordExt *curr) const;
bool has_collisions (KeywordExt *curr);