The original has index set to 0 only for time_info.hours == 6 and 20. Your change sets it to zero regardless of the time, provided that move is false. I haven't looked at the surrounding code, but this may break the intentions of the routine. As for the "saving a line" and saving time issue... if the move setting is such that index=0 is correct for any value of time_info.hours, then your change is better programming because it eliminates unnecessary redundancy. No time would be saved however, since the setting would get done at one point or the other. At 06:53 PM 6/8/99 -0500, you wrote: >In specprocs.c, around line 309, the stock code has: > > if (!move) { > if (time_info.hours == 6) { > move = TRUE; > path = open_path; > index = 0; > } else if (time_info.hours == 20) { > move = TRUE; > path = close_path; > index = 0; > } > } > >Wouldn't it be easier to change that to: > > if (!move) { > index = 0; > if (time_info.hours == 6) { > move = TRUE; > path = open_path; > } else if (time_info.hours == 20) { > move = TRUE; > path = close_path; > } > } > >? >That would only save 1 line, and would probably not make a big change in >time. Or is there some reason I'm missing to keep two 'index = 0;'s >around? > >-Axiem >-axiem@swbell.net > > > +------------------------------------------------------------+ > | Ensure that you have read the CircleMUD Mailing List FAQ: | > | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | > +------------------------------------------------------------+ +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST