On Fri, Aug 8, 2008 at 5:51 PM, Gustavo Sverzut Barbieri
<[EMAIL PROTECTED]> wrote:
> On Fri, Aug 8, 2008 at 7:39 AM, Enlightenment CVS
> <[EMAIL PROTECTED]> wrote:
>
>> +EAPI void eina_error_print(Eina_Error_Level level, const char *file,
>>                const char *fnc, int line, const char *fmt, ...)
>>  {
>>        va_list args;
>>
>>        va_start(args, fmt);
>> -       _error_print(level, file, fnc, line, fmt, args);
>> +       if (level <= _error_level)
>> +               _print_cb(level, file, fnc, line, fmt, _print_cb_data, args);
>>        va_end(args);
>> +}
>
> Let's try to avoid this useless nesting and also making it more
> optimized, in this case, by using:
>
> if (premature-exit-condition)
>    return;
>
> real-code.
>

Of course it should be like that, thanks for pointing it out, for
small code like this please commit the fix directly, if you have time
of course

Regards

> in this case you'd avoid va_start()/va_end():
>
> if (level > _error_level)
>    return;
>
> va_start(args, fmt);
> _print_cb(level, file, fnc, line, fmt, _print_cb_data, args);
> va_end(args);
>
> code is simpler, can be smaller if you need to add more things inside
> va_start/end....
>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: [EMAIL PROTECTED]
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to