ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/objset.c
(Generate patch)

Comparing ray/src/common/objset.c (file contents):
Revision 2.6 by gwlarson, Tue Aug 18 17:18:51 1998 UTC vs.
Revision 2.7 by gwlarson, Fri Sep 11 15:26:43 1998 UTC

# Line 68 | Line 68 | OBJECT  obj;
68          int  upper, lower;
69          register int  cm, i;
70  
71 +        if ((i = os[0]) <= 6) {         /* linear search algorithm */
72 +                cm = obj;
73 +                while (i-- > 0)
74 +                        if (*++os == cm)
75 +                                return(1);
76 +                return(0);
77 +        }
78          lower = 1;
79 <        upper = cm = os[0] + 1;
79 >        upper = cm = i + 1;
80                                          /* binary search algorithm */
81          while ((i = (lower + upper) >> 1) != cm) {
82                  cm = obj - os[i];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines