From 44f4b94b3813d75e2e2c0bd435295423cbcd514a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 16 Feb 2004 18:38:46 +0000 Subject: [PATCH] Don't bother storing a result when all you need are the side effects. --- sys/kern/kern_descrip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index dba542d0551..c5e005bc2a1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -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); }