]> granicus.if.org Git - php/commitdiff
Simplify and cleanup code.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 27 Oct 2004 23:12:05 +0000 (23:12 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 27 Oct 2004 23:12:05 +0000 (23:12 +0000)
ext/standard/microtime.c

index a9e6d3bd09a66036c28669568b0880794ed9a63d..fbf8e02500baf6b5db2574794b9615630e423b99 100644 (file)
@@ -107,20 +107,15 @@ PHP_FUNCTION(gettimeofday)
    Returns an array of usage statistics */
 PHP_FUNCTION(getrusage)
 {
-       struct rusage usg;
-       int ac = ZEND_NUM_ARGS();
-       pval **pwho;
+       struct rusage usg = {0};
+       long pwho = 0;
        int who = RUSAGE_SELF;
 
-       if(ac == 1 &&
-               zend_get_parameters_ex(ac, &pwho) != FAILURE) {
-               convert_to_long_ex(pwho);
-               if(Z_LVAL_PP(pwho) == 1)
-                       who = RUSAGE_CHILDREN;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) {
+               who = RUSAGE_CHILDREN;
        }
 
-       memset(&usg, 0, sizeof(usg));
-       if(getrusage(who, &usg) == -1) {
+       if (getrusage(who, &usg) == -1) {
                RETURN_FALSE;
        }