Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
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
uplex-varnish
trackrdrd
Commits
59d2b74e
Commit
59d2b74e
authored
Feb 18, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: hash_insert without goto
parent
c7311045
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
child.c
trackrdrd/src/child.c
+28
-28
No files found.
trackrdrd/src/child.c
View file @
59d2b74e
...
@@ -499,9 +499,7 @@ static hashentry
...
@@ -499,9 +499,7 @@ static hashentry
uint32_t
h
=
h1
(
xid
);
uint32_t
h
=
h1
(
xid
);
he
=
&
htbl
.
entry
[
INDEX
(
h
)];
he
=
&
htbl
.
entry
[
INDEX
(
h
)];
if
(
he
->
state
==
HASH_EMPTY
)
if
(
he
->
state
!=
HASH_EMPTY
)
{
goto
ok
;
htbl
.
collisions
++
;
htbl
.
collisions
++
;
oldest
=
he
;
oldest
=
he
;
...
@@ -512,7 +510,7 @@ static hashentry
...
@@ -512,7 +510,7 @@ static hashentry
probes
++
;
probes
++
;
if
(
he
->
state
==
HASH_EMPTY
)
if
(
he
->
state
==
HASH_EMPTY
)
goto
o
k
;
brea
k
;
if
(
he
->
insert_time
<
oldest
->
insert_time
)
if
(
he
->
insert_time
<
oldest
->
insert_time
)
oldest
=
he
;
oldest
=
he
;
n
++
;
n
++
;
...
@@ -520,6 +518,7 @@ static hashentry
...
@@ -520,6 +518,7 @@ static hashentry
}
while
(
probes
<=
htbl
.
max_probes
);
}
while
(
probes
<=
htbl
.
max_probes
);
/* none eligible for evacuation */
/* none eligible for evacuation */
if
(
he
->
state
!=
HASH_EMPTY
)
{
if
((
oldest
->
insert_time
+
htbl
.
mlt
)
>
t
)
{
if
((
oldest
->
insert_time
+
htbl
.
mlt
)
>
t
)
{
htbl
.
fail
++
;
htbl
.
fail
++
;
htbl
.
insert_probes
+=
probes
;
htbl
.
insert_probes
+=
probes
;
...
@@ -528,8 +527,9 @@ static hashentry
...
@@ -528,8 +527,9 @@ static hashentry
hash_evacuate
(
oldest
);
hash_evacuate
(
oldest
);
he
=
oldest
;
he
=
oldest
;
}
}
ok:
htbl
.
insert_probes
+=
probes
;
htbl
.
insert_probes
+=
probes
;
he
->
state
=
HASH_OPEN
;
he
->
state
=
HASH_OPEN
;
...
...
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