Re: [PATCH] scripts: improve checkstack

From: Cong Wang
Date: Sat Feb 20 2010 - 02:32:35 EST


Stephen Hemminger wrote:
Turn on strict checking, and get rid of annoying use of prototype.
Fix syntax error in declaration

Use efficient sort algorithm by using schwartzian transform.
http://en.wikipedia.org/wiki/Schwartzian_transform


Yeah, the idea is good, this can also make it more perlish. ;)

But...


-print sort bysize @stack;
+# Use Schwartzian transform to sort by last field (size)
+print map { $_->[0] }
+ sort { $b->[1] <=> $a->[1] }
+ map { [$_, /:\t*(\d+)$/] } @stack;

This regex here is not strictly the same as before.

Can we just keep the original regex? If not, what's wrong?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/