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
Automate
Agent sessions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
c10e04d5
Commit
c10e04d5
authored
Jun 20, 2017
by
Adrien Béraud
Committed by
GitHub
Jun 20, 2017
Browse files
Options
Downloads
Plain Diff
Merge pull request #195 from GrossoMoreira/patch-1
Avoid dereferencing an iterator to 'end()'
parents
2ed99db9
ee883492
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/infohash.cpp
+2
-2
2 additions, 2 deletions
src/infohash.cpp
with
2 additions
and
2 deletions
src/infohash.cpp
+
2
−
2
View file @
c10e04d5
...
@@ -65,8 +65,8 @@ InfoHash::getRandom()
...
@@ -65,8 +65,8 @@ InfoHash::getRandom()
InfoHash
h
;
InfoHash
h
;
crypto
::
random_device
rdev
;
crypto
::
random_device
rdev
;
std
::
uniform_int_distribution
<
uint32_t
>
rand_int
;
std
::
uniform_int_distribution
<
uint32_t
>
rand_int
;
auto
a
=
reinterpret_cast
<
uint32_t
*>
(
&
(
*
h
.
begin
()
));
auto
a
=
reinterpret_cast
<
uint32_t
*>
(
h
.
data
(
));
auto
b
=
reinterpret_cast
<
uint32_t
*>
(
&
(
*
h
.
end
()
));
auto
b
=
reinterpret_cast
<
uint32_t
*>
(
h
.
data
()
+
h
.
size
(
));
std
::
generate
(
a
,
b
,
std
::
bind
(
rand_int
,
std
::
ref
(
rdev
)));
std
::
generate
(
a
,
b
,
std
::
bind
(
rand_int
,
std
::
ref
(
rdev
)));
return
h
;
return
h
;
}
}
...
...
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
sign in
to comment