nodeinfo: Prefer MIN in nodeGetFreePages

It's better to use a macro instead of if-else construct.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2014-09-23 11:34:06 +02:00
parent 60c4ae454e
commit f8857c8f88

View File

@ -2041,9 +2041,7 @@ nodeGetFreePages(unsigned int npages,
goto cleanup;
}
lastCell = startCell + cellCount;
if (startCell + cellCount < lastCell)
lastCell = startCell + cellCount;
lastCell = MIN(lastCell, startCell + cellCount);
for (cell = startCell; cell < lastCell; cell++) {
for (i = 0; i < npages; i++) {