On Tuesday 24 July 2007 15:37:54 [EMAIL PROTECTED] wrote:

> Modified: trunk/src/ops/var.ops
> ===========================================================================
>=== --- trunk/src/ops/var.ops       (original)
> +++ trunk/src/ops/var.ops       Tue Jul 24 15:37:53 2007
> @@ -105,8 +105,8 @@
>  
>  op get_namespace(out PMC, in PMC) {
>      PMC * const cur_ns = CONTEXT(interp->ctx)->current_namespace;
> -    PMC *ns = Parrot_get_namespace_keyed(interp, cur_ns, $2);
> -    $1 = ns ? ns : PMCNULL;
> +    PMC * const ns = Parrot_get_namespace_keyed(interp, cur_ns, $2);
> +    $1 = PMC_IS_NULL(ns) ? PMCNULL : ns;
>      goto NEXT();
>  }

How about:

$1 = Parrot_get_namespace_keyed(interp, cur_ns, $2);

I presume that the function always returns either PMCNULL or a NameSpace PMC, 
so checking if it's returned PMCNULL and returning PMCNULL in that case seems 
a little silly.

-- c

Reply via email to