Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
a04d77bc
Commit
a04d77bc
authored
Jul 07, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use want_i instead of last_i+1.
parent
25bd9945
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
match.c
match.c
+10
-10
No files found.
match.c
View file @
a04d77bc
...
...
@@ -142,14 +142,14 @@ static void hash_search(int f,struct sum_struct *s,
{
OFF_T
offset
,
end
;
unsigned
int
k
;
size_t
las
t_i
;
size_t
wan
t_i
;
char
sum2
[
SUM_LENGTH
];
uint32
s1
,
s2
,
sum
;
schar
*
map
;
/*
last_i is used to encourage adjacent matches, allowing the RLL coding of the
output to work more efficiently
*/
last_i
=
(
size_t
)
-
1
;
/*
want_i is used to encourage adjacent matches, allowing the RLL
* coding of the output to work more efficiently.
*/
want_i
=
0
;
if
(
verbose
>
2
)
{
rprintf
(
FINFO
,
"hash search b=%u len=%.0f
\n
"
,
...
...
@@ -216,15 +216,15 @@ static void hash_search(int f,struct sum_struct *s,
}
/* we've found a match, but now check to see
* if
last_i can hint at a better match
*/
if
(
i
!=
last_i
+
1
&&
last_i
+
1
<
s
->
count
&&
sum
==
s
->
sums
[
last_i
+
1
].
sum1
&&
memcmp
(
sum2
,
s
->
sums
[
last_i
+
1
].
sum2
,
s
->
s2length
)
==
0
)
{
* if
want_i can hint at a better match.
*/
if
(
i
!=
want_i
&&
want_i
<
s
->
count
&&
sum
==
s
->
sums
[
want_i
].
sum1
&&
memcmp
(
sum2
,
s
->
sums
[
want_i
].
sum2
,
s
->
s2length
)
==
0
)
{
/* we've found an adjacent match - the RLL coder
* will be happy */
i
=
last_i
+
1
;
i
=
want_i
;
}
last_i
=
i
;
want_i
=
i
+
1
;
matched
(
f
,
s
,
buf
,
offset
,
i
);
offset
+=
s
->
sums
[
i
].
len
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment