Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0052a02

Browse files
committed
Add a hash_combine function for mixing hash values.
This hash function is derived from Boost's function of the same name.Author: Andres Freund, Thomas MunroDiscussion:https://postgr.es/m/CAEepm%3D3rdgjfxW4cKvJ0OEmya2-34B0qHNG1xV0vK7TGPJGMUQ%40mail.gmail.comDiscussion:https://postgr.es/m/20170731210844.3cwrkmsmbbpt4rjc%40alap3.anarazel.de
1 parent2bfd1b1 commit0052a02

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎src/include/utils/hashutils.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Utilities for working with hash values.
3+
*
4+
* Portions Copyright (c) 2017, PostgreSQL Global Development Group
5+
*/
6+
7+
#ifndefHASHUTILS_H
8+
#defineHASHUTILS_H
9+
10+
/*
11+
* Combine two hash values, resulting in another hash value, with decent bit
12+
* mixing.
13+
*
14+
* Similar to boost's hash_combine().
15+
*/
16+
staticinlineuint32
17+
hash_combine(uint32a,uint32b)
18+
{
19+
a ^=b+0x9e3779b9+ (a <<6)+ (a >>2);
20+
returna;
21+
}
22+
23+
#endif/* HASHUTILS_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp