Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renamed sum_table -> hash_table.
[rsync/rsync.git]
/
match.c
diff --git
a/match.c
b/match.c
index
ee49a0e
..
19b17c5
100644
(file)
--- a/
match.c
+++ b/
match.c
@@
-38,9
+38,9
@@
static int total_matches;
extern struct stats stats;
static uint32 tablesize;
extern struct stats stats;
static uint32 tablesize;
-static int32 *
sum
_table;
+static int32 *
hash
_table;
-#define
GETTAG
(sum) ((sum)%tablesize)
+#define
SUM2HASH
(sum) ((sum)%tablesize)
static void build_hash_table(struct sum_struct *s)
{
static void build_hash_table(struct sum_struct *s)
{
@@
-54,18
+54,18
@@
static void build_hash_table(struct sum_struct *s)
if (tablesize < 65537)
tablesize = 65537; /* a prime number */
if (tablesize != prior_size) {
if (tablesize < 65537)
tablesize = 65537; /* a prime number */
if (tablesize != prior_size) {
- free(
sum
_table);
-
sum
_table = new_array(int32, tablesize);
- if (!
sum
_table)
+ free(
hash
_table);
+
hash
_table = new_array(int32, tablesize);
+ if (!
hash
_table)
out_of_memory("build_hash_table");
}
out_of_memory("build_hash_table");
}
- memset(
sum_table, 0xFF, tablesize * sizeof sum
_table[0]);
+ memset(
hash_table, 0xFF, tablesize * sizeof hash
_table[0]);
for (i = 0; i < s->count; i++) {
for (i = 0; i < s->count; i++) {
- uint32 t =
GETTAG
(s->sums[i].sum1);
- s->sums[i].chain =
sum
_table[t];
-
sum
_table[t] = i;
+ uint32 t =
SUM2HASH
(s->sums[i].sum1);
+ s->sums[i].chain =
hash
_table[t];
+
hash
_table[t] = i;
}
}
}
}
@@
-162,13
+162,11
@@
static void hash_search(int f,struct sum_struct *s,
do {
int done_csum2 = 0;
int32 i;
do {
int done_csum2 = 0;
int32 i;
- uint32 t;
if (verbose > 4)
rprintf(FINFO,"offset=%.0f sum=%08x\n",(double)offset,sum);
if (verbose > 4)
rprintf(FINFO,"offset=%.0f sum=%08x\n",(double)offset,sum);
- t = GETTAG(sum);
- i = sum_table[t];
+ i = hash_table[SUM2HASH(sum)];
if (i < 0)
goto null_hash;
if (i < 0)
goto null_hash;