Hi,

+1 for removing the else part. When I did profiling the hit count of this
AXIS2_ERROR_SET_STATUS_CODE is very high and it takes a considerable amount
of CPU time as well.

Supun..

On Mon, Jun 9, 2008 at 7:57 PM, Dimuthu Gamage <[EMAIL PROTECTED]> wrote:

> Hi devs,
>
> Currently in AXIS2_PARAM_CHECK, if the param is null we set the status code
> to AXIS2_FAILURE and if not null set the status code AXIS2_SUCCESSS
>
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error,
> AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
>
>
> My question is, is it ok to set the status code to AXIS2_SUCCESS,
> Because
> 1. If  we are in happy path, the status code is already AXIS2_SUCCESS, we
> don't need to explicitly set that.
> 2. The macro can overwrite the status, That is if the status is already set
> to failure by an early case, this macro will overwrite the status to SUCCESS
> which is wrong.
>
> So my suggestion is to remove the else part from that macro?. Please let me
> know your ideas, I may be wrong on this.
>
> Thanks
> Dimuthu
>

Reply via email to