optimize: Change the list_empty() condition in swp_bfree
commit92406fc5948e4c820a3d7c1d784278978e1b8a87
authorPetr Tesarik <petr@tesarici.cz>
Tue, 27 Sep 2011 14:51:14 +0000 (27 16:51 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Tue, 27 Sep 2011 14:51:14 +0000 (27 16:51 +0200)
tree5aed648fc9c7898eb92c4e75c60ec3339414b659
parente1bd215cd0b4098154fff6393188b3d8dd90d100
optimize: Change the list_empty() condition in swp_bfree

The usual list_empty() macro looks at the next field. But since the loop
goes backwards, it only looks at the prev field. Consequently, the
compiler cannot optimize a common subexpression.

It is equally good to test the prev field, and we can do it here.
src/file/swap.c