lkml.org 
[lkml]   [2009]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf lock: Implement basic sorting function of perf lock
From
Date
On Sun, 2009-12-20 at 11:56 +0900, Hitoshi Mitake wrote:
> +#define SINGLE_KEY(member) \
> + static int lock_stat_key_ ## member(struct lock_stat *one, \
> + struct lock_stat *two) \
> + { \
> + if (one->member > two->member) \
> + return 1; \
> + else \
> + return 0; \
> + }

Seems to me:

return one->member > two->member;

Should suffice, no?

[ I usually call the arguments to a comparator (l)eft/(r)ight or a/b,
but I guess one/two works too :-) ]



\
 
 \ /
  Last update: 2009-12-28 12:01    [W:0.351 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site