Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
6855aaa6
Commit
6855aaa6
authored
8 years ago
by
kaldoran
Committed by
Adrien Béraud
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Correction of error on SwapBit
parent
2aee4f41
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/opendht/indexation/pht.h
+2
-2
2 additions, 2 deletions
include/opendht/indexation/pht.h
with
2 additions
and
2 deletions
include/opendht/indexation/pht.h
+
2
−
2
View file @
6855aaa6
...
@@ -124,7 +124,7 @@ struct Prefix {
...
@@ -124,7 +124,7 @@ struct Prefix {
* @throw out_of_range Throw out of range if bit does not exist
* @throw out_of_range Throw out of range if bit does not exist
*/
*/
Prefix
swapBit
(
size_t
bit
)
const
{
Prefix
swapBit
(
size_t
bit
)
const
{
if
(
bit
>=
size_
)
if
(
bit
>=
content_
.
size
()
*
8
)
throw
std
::
out_of_range
(
"bit larger than prefix size."
);
throw
std
::
out_of_range
(
"bit larger than prefix size."
);
Prefix
copy
=
*
this
;
Prefix
copy
=
*
this
;
...
@@ -261,7 +261,7 @@ private:
...
@@ -261,7 +261,7 @@ private:
Prefix
p
=
Blob
{
k
.
begin
()
->
second
.
begin
(),
k
.
begin
()
->
second
.
end
()};
Prefix
p
=
Blob
{
k
.
begin
()
->
second
.
begin
(),
k
.
begin
()
->
second
.
end
()};
auto
bit_loc
=
p
.
size_
+
1
;
auto
bit_loc
=
p
.
size_
+
1
;
for
(
auto
i
=
p
.
content_
.
size
();
i
<
=
keySpec_
.
begin
()
->
second
;
i
++
)
for
(
auto
i
=
p
.
content_
.
size
();
i
<
keySpec_
.
begin
()
->
second
+
1
;
i
++
)
p
.
content_
.
push_back
(
0
);
p
.
content_
.
push_back
(
0
);
return
p
.
swapBit
(
bit_loc
);
return
p
.
swapBit
(
bit_loc
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment