Skip to content

Commit 3ec5299

Browse files
committed
WIP
1 parent 976d7ed commit 3ec5299

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Zend/zend_virtual_cwd.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ CWD_API char *virtual_getcwd(char *buf, size_t size) /* {{{ */
317317
#ifdef ZEND_WIN32
318318
static inline zend_ulong realpath_cache_key(const char *path, size_t path_len) /* {{{ */
319319
{
320-
zend_ulong h;
321320
size_t bucket_key_len;
322321
const char *bucket_key_start = tsrm_win32_get_path_sid_key(path, path_len, &bucket_key_len);
323322
const char *bucket_key = bucket_key_start;
@@ -328,10 +327,7 @@ static inline zend_ulong realpath_cache_key(const char *path, size_t path_len) /
328327
}
329328

330329
e = bucket_key + bucket_key_len;
331-
for (h = Z_UL(2166136261); bucket_key < e;) {
332-
h *= Z_UL(16777619);
333-
h ^= *bucket_key++;
334-
}
330+
zend_ulong h = zend_hash_func(path, path_len);
335331
if (bucket_key_start != path) {
336332
HeapFree(GetProcessHeap(), 0, (LPVOID)bucket_key_start);
337333
}
@@ -341,15 +337,7 @@ static inline zend_ulong realpath_cache_key(const char *path, size_t path_len) /
341337
#else
342338
static inline zend_ulong realpath_cache_key(const char *path, size_t path_len) /* {{{ */
343339
{
344-
zend_ulong h;
345-
const char *e = path + path_len;
346-
347-
for (h = Z_UL(2166136261); path < e;) {
348-
h *= Z_UL(16777619);
349-
h ^= *path++;
350-
}
351-
352-
return h;
340+
return zend_hash_func(path, path_len);
353341
}
354342
/* }}} */
355343
#endif /* defined(ZEND_WIN32) */

0 commit comments

Comments
 (0)