Changeset 6efe1b78 in mainline
- Timestamp:
- 2020-07-05T21:10:18Z (4 years ago)
- Children:
- b3c169e6
- Parents:
- 0f75a63
- git-author:
- Matthieu Riolo <matthieu.riolo@…> (2020-04-13 20:52:27)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2020-07-05 21:10:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash.h
r0f75a63 r6efe1b78 111 111 } 112 112 113 /** Calculate hash of NULL-terminated string 114 * 115 * TODO Modify also same file in kernel subtree? 116 * 117 * @param[in] str NULL-terminated string 118 * @return hash of the given string 119 */ 120 static inline size_t hash_string(const char *str) 121 { 122 size_t hash = 0; 123 if (str != NULL) { 124 char c; 125 while ((c = *str++) != 0) { 126 hash = hash_combine(hash, c); 127 } 128 } 129 130 return hash; 131 } 132 113 133 #endif
Note:
See TracChangeset
for help on using the changeset viewer.