Don't manually optimize for 20 year old compilers by casting to u_int

to get a free check for negative ints.  Rev.1.35 got my request to
remove the cast mostly backwards.
This commit is contained in:
Bruce Evans 2004-03-04 11:20:02 +00:00
parent 92babce456
commit 47e600b575
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126592

View File

@ -163,8 +163,7 @@ static __inline struct file *
fget_locked(struct filedesc *fdp, int fd)
{
/* u_int cast checks for negative descriptors. */
return ((u_int)fd >= (u_int)fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]);
return (fd < 0 || fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]);
}
extern struct mtx fdesc_mtx;