cvs: pecl /phar dirstream.c

From: Date: Sun, 13 Apr 2008 23:47:14 +0000
Subject: cvs: pecl /phar dirstream.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-10364@lists.php.net to get a copy of this message
cellog Sun Apr 13 23:47:14 2008 UTC Modified files: /pecl/phar dirstream.c Log: minor optimization http://cvs.php.net/viewvc.cgi/pecl/phar/dirstream.c?r1=1.15&r2=1.16&diff_format=u Index: pecl/phar/dirstream.c diff -u pecl/phar/dirstream.c:1.15 pecl/phar/dirstream.c:1.16 --- pecl/phar/dirstream.c:1.15 Sun Apr 13 23:46:14 2008 +++ pecl/phar/dirstream.c Sun Apr 13 23:47:14 2008 @@ -63,27 +63,27 @@ { HashTable *data = (HashTable *)stream->abstract; - if (data) + if (!data) { - if (whence == SEEK_END) { - whence = SEEK_SET; - offset = zend_hash_num_elements(data) + offset; - } - if (whence == SEEK_SET) { - zend_hash_internal_pointer_reset(data); - } + return -1; + } + if (whence == SEEK_END) { + whence = SEEK_SET; + offset = zend_hash_num_elements(data) + offset; + } + if (whence == SEEK_SET) { + zend_hash_internal_pointer_reset(data); + } - if (offset < 0) { - return -1; - } else { - *newoffset = 0; - while (*newoffset < offset && zend_hash_move_forward(data) == SUCCESS) { - ++(*newoffset); - } - return 0; + if (offset < 0) { + return -1; + } else { + *newoffset = 0; + while (*newoffset < offset && zend_hash_move_forward(data) == SUCCESS) { + ++(*newoffset); } + return 0; } - return -1; } /* }}} */

« previous php.pecl.cvs (#10364) next »