[Geany-devel] debugger plugin
Colomban Wendling
lists.ban at xxxxx
Wed Feb 9 23:58:12 UTC 2011
Le 10/02/2011 00:55, Chow Loong Jin a écrit :
> On Thursday 10,February,2011 02:16 AM, Thomas Martitz wrote:
>> Am 09.02.2011 17:57, schrieb Chow Loong Jin:
>>
>>> gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data)
>>> {
>>> - if (a == b)
>>> + gint ia = GPOINTER_TO_INT(a);
>>> + gint ib = GPOINTER_TO_INT(b);
>>> + if (ia == ib)
>>> return 0;
>>> else
>>> - return a> b ? 1 : -1;
>>> + return ia> ib ? 1 : -1;
>>> }
>>
>> FWIW, this can be replaced with "return ia - ib".
>
> Ooh cool, I didn't think of that. Thanks for the tip! Here's a revised patch.
No more need for a temporary variable then, since the value is used only
once ;)
More information about the Devel
mailing list