Don't bother storing a result when all you need are the side effects.

This commit is contained in:
Dag-Erling Smørgrav 2004-02-16 18:38:46 +00:00
parent b14160b848
commit 44f4b94b38
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125881

View File

@ -126,13 +126,13 @@ fd_first_free(struct filedesc *fdp, int low, int size)
off = NDSLOT(low);
if (low % NDENTRIES) {
mask = ~(~(NDSLOTTYPE)0 >> (NDENTRIES - (low % NDENTRIES)));
if ((mask &= ~map[off]) != 0)
if ((mask &= ~map[off]) != 0UL)
return (off * NDENTRIES + ffsl(mask) - 1);
++off;
}
for (maxoff = NDSLOTS(size); off < maxoff; ++off)
if ((mask = ~map[off]) != 0)
return (off * NDENTRIES + ffsl(mask) - 1);
if (map[off] != ~0UL)
return (off * NDENTRIES + ffsl(~map[off]) - 1);
return (size);
}
@ -158,8 +158,8 @@ fd_last_used(struct filedesc *fdp, int low, int size)
--off;
}
for (minoff = NDSLOT(low); off >= minoff; --off)
if ((mask = map[off]) != 0)
return (off * NDENTRIES + flsl(mask) - 1);
if (map[off] != 0)
return (off * NDENTRIES + flsl(map[off]) - 1);
return (size - 1);
}