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
OpenDAS
dlib
Commits
5bdf93ef
Commit
5bdf93ef
authored
May 28, 2011
by
Davis King
Browse files
Switched the default hash function for std::strings (when used with hash tables)
to dlib::hash().
parent
6335f110
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
dlib/general_hash/general_hash.h
dlib/general_hash/general_hash.h
+2
-5
No files found.
dlib/general_hash/general_hash.h
View file @
5bdf93ef
...
...
@@ -5,6 +5,7 @@
#include <string>
#include "hash.h"
namespace
dlib
{
...
...
@@ -68,11 +69,7 @@ namespace dlib
const
std
::
string
&
item
)
const
{
unsigned
long
hash
=
0
;
std
::
string
::
size_type
size
=
item
.
size
();
for
(
std
::
string
::
size_type
i
=
0
;
i
<
size
;
++
i
)
hash
=
hash
*
37
+
static_cast
<
unsigned
long
>
(
item
[
i
]);
return
hash
;
return
hash
(
item
);
}
// ----------------------------------------------------------------------------------------
...
...
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