8000 cleanup code for unsupported versions · phpredis/phpredis@37cebdd · GitHub
[go: up one dir, main page]

Skip to content

Commit 37cebdd

Browse files
remicolletmichael-grunder
authored andcommitted
cleanup code for unsupported versions
1 parent 8b51942 commit 37cebdd

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

backoff.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
#include <ext/random/php_random.h>
77
#endif
88

9-
#if PHP_VERSION_ID < 70100
10-
static zend_long php_mt_rand_range(zend_long min, zend_long max) {
11-
return min + php_rand() % (max - min + 1)
12-
}
13-
#endif
14-
159
#include "backoff.h"
1610

1711
static zend_ulong random_range(zend_ulong min, zend_ulong max) {

library.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,7 @@ static int redis_mbulk_reply_zipped_raw_variant(RedisSock *redis_sock, zval *zre
100100

101101
/* Register a persistent resource in a a way that works for every PHP 7 version. */
102102
void redis_register_persistent_resource(zend_string *id, void *ptr, int le_id) {
103-
#if PHP_VERSION_ID < 70300
104-
zend_resource res;
105-
res.type = le_id;
106-
res.ptr = ptr;
107-
108-
zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(id), ZSTR_LEN(id), &res, sizeof(res));
109-
#else
110103
zend_register_persistent_resource(ZSTR_VAL(id), ZSTR_LEN(id), ptr, le_id);
111-
#endif
112104
}
113105

114106
static ConnectionPool *

redis_session.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,7 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_
413413
}
414414
}
415415

416-
#if PHP_VERSION_ID < 70300
417-
#define REDIS_URL_STR(umem) umem
418-
#else
419416
#define REDIS_URL_STR(umem) ZSTR_VAL(umem)
420-
#endif
421417

422418
/* {{{ PS_OPEN_FUNC
423419
*/

0 commit comments

Comments
 (0)
0