Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
56f6521c
Commit
56f6521c
authored
Jan 29, 2016
by
Willem Thiart
Browse files
Prepare log_get_from_idx for log compaction
parent
a20e8592
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/raft_log.c
View file @
56f6521c
...
...
@@ -118,12 +118,12 @@ raft_entry_t* log_get_from_idx(log_t* me_, int idx, int *n_etys)
i
=
(
me
->
front
+
idx
-
me
->
base
)
%
me
->
size
;
assert
(
i
<=
me
->
back
)
;
int
logs_till_end_of_log
;
i
nt
logs_till_end_of_log
=
me
->
back
-
i
;
/* idx - me->front - me->base; */
/* i = */
i
f
(
i
<
me
->
back
)
logs_till_end_of_log
=
me
->
back
-
i
;
else
logs_till_end_of_log
=
me
->
size
-
i
;
*
n_etys
=
logs_till_end_of_log
;
return
&
me
->
entries
[
i
];
...
...
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