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.5 by gregl, Wed Dec 3 11:14:00 1997 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];
# Line 228 | Line 235 | OCTREE  ot;
235  
236          if (!isfull(ot))
237                  goto noderr;
238 <        i = oseti(ot);
239 <        if ((os = ostable[i%OSTSIZ]) == NULL)
238 >        ot = oseti(ot);
239 >        if ((os = ostable[ot%OSTSIZ]) == NULL)
240                  goto noderr;
241 <        for (i /= OSTSIZ; i--; os += *os + 1)
241 >        for (i = ot/OSTSIZ; i--; os += *os + 1)
242                  if (*os <= 0)
243                          goto noderr;
244          for (i = *os; i-- >= 0; )               /* copy set here */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines