summaryrefslogtreecommitdiff
path: root/ext/spl/spl_engine.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2012-03-04 13:52:48 +0000
committerNikita Popov <nikic@php.net>2012-03-04 13:52:48 +0000
commit3bc1455496bdc2307b0288bb3fad09b6dd61ac93 (patch)
tree0e16e658a20076e2c2f0226ac63cbf0e938d8fd2 /ext/spl/spl_engine.c
parent0fe734b7c89a914de91ed046ac65848580569a6e (diff)
downloadphp-git-3bc1455496bdc2307b0288bb3fad09b6dd61ac93.tar.gz
Fix bug #60596: Code Cleanup Removing Superfluous If Statement
Cleanup only, no function change. Patch by ircmaxell.
Diffstat (limited to 'ext/spl/spl_engine.c')
-rwxr-xr-xext/spl/spl_engine.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c
index 9273308b13..d501f31435 100755
--- a/ext/spl/spl_engine.c
+++ b/ext/spl/spl_engine.c
@@ -45,19 +45,16 @@ PHPAPI void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRM
PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
{
- switch(Z_TYPE_P(offset)) {
+ switch (Z_TYPE_P(offset)) {
case IS_STRING:
ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, idx);
break;
case IS_DOUBLE:
+ return (long)Z_DVAL_P(offset);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
- return (long)Z_DVAL_P(offset);
- } else {
- return Z_LVAL_P(offset);
- }
+ return Z_LVAL_P(offset);
}
return -1;
}