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

Comparing ray/src/util/eplus_idf.c (file contents):
Revision 2.6 by greg, Mon Feb 10 04:51:26 2014 UTC vs.
Revision 2.7 by greg, Tue Feb 11 23:30:11 2014 UTC

# Line 163 | Line 163 | idf_movparam(IDF_LOADED *idf, IDF_PARAMETER *param, ID
163  
164          if ((idf == NULL) | (param == NULL))
165                  return(0);
166 +                                        /* quick check if already there */
167 +        if (param == (prev==NULL ? idf->pfirst : prev->dnext))
168 +                return(1);
169                                          /* find in IDF list, first*/
170          for (plast = NULL, pptr = idf->pfirst;
171                                  pptr != param; plast = pptr, pptr = pptr->dnext)
172                  if (pptr == NULL)
173                          return(0);
174 <        if (plast == NULL) {
172 <                if (prev == NULL)
173 <                        return(1);      /* already in place */
174 >        if (plast == NULL)
175                  idf->pfirst = param->dnext;
176 <        } else {
176 <                if (prev == plast)
177 <                        return(1);      /* already in place */
176 >        else
177                  plast->dnext = param->dnext;
179        }
178          if (idf->plast == param)
179                  idf->plast = plast;
180          if (prev == NULL) {             /* means they want it at beginning */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines