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
441a40ce
Commit
441a40ce
authored
8 years ago
by
Simon Désaulniers
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #116 from kaldoran/filter_pht_values
pht : Filter of duplicate values
parents
f7fa7d06
ef8b9d44
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/indexation/pht.cpp
+12
-4
12 additions, 4 deletions
src/indexation/pht.cpp
with
12 additions
and
4 deletions
src/indexation/pht.cpp
+
12
−
4
View file @
441a40ce
...
...
@@ -28,13 +28,13 @@ static std::string blobToString(const Blob &bl) {
std
::
string
Prefix
::
toString
()
const
{
std
::
stringstream
ss
;
ss
<<
"Prefix : "
<<
std
::
endl
<<
"
\t
Content_ : "
;
ss
<<
"Prefix : "
<<
std
::
endl
<<
"
\t
Content_ :
\"
"
;
ss
<<
blobToString
(
content_
);
ss
<<
std
::
endl
;
ss
<<
"
\"
"
<<
std
::
endl
;
ss
<<
"
\t
Flags_
:
"
;
ss
<<
"
\t
Flags_
:
\"
"
;
ss
<<
blobToString
(
flags_
);
ss
<<
std
::
endl
;
ss
<<
"
\"
"
<<
std
::
endl
;
return
ss
.
str
();
}
...
...
@@ -193,6 +193,14 @@ void Pht::lookupStep(Prefix p, std::shared_ptr<int> lo, std::shared_ptr<int> hi,
IndexEntry
entry
;
entry
.
unpackValue
(
*
value
);
auto
it
=
std
::
find_if
(
vals
->
cbegin
(),
vals
->
cend
(),
[
&
](
const
std
::
shared_ptr
<
IndexEntry
>&
ie
)
{
return
ie
->
value
==
entry
.
value
;
});
/* If we already got the value then get the next one */
if
(
it
!=
vals
->
cend
())
return
true
;
if
(
max_common_prefix_len
)
{
/* inexact match case */
auto
common_bits
=
Prefix
::
commonBits
(
p
,
entry
.
prefix
);
...
...
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