Permalink
Browse files

Fix bug #60596: Code Cleanup Removing Superfluous If Statement

Cleanup only, no function change. Patch by ircmaxell.
  • Loading branch information...
1 parent be202d3 commit 4e2e632fbdd587de502b4db603b1e15a2176a633 @nikic nikic committed Mar 4, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 ext/spl/spl_engine.c
View
@@ -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;
}

0 comments on commit 4e2e632

Please sign in to comment.