Re: Circlemud design issues

From: James Turner (turnerjh@XTN.NET)
Date: 04/23/98


George <greerga@CIRCLEMUD.ORG> writes:

> >  for (i = 0; i < MAX_PARAMS; i++)
> >    split_results[i][0] = 0;
>
> memset?
>
> Somewhat overkill, but if you don't unroll that loop it would be faster.

Sure, bzero or memset would be just as good.  The code is non-optimized.

> >  while(*arg && isspace(*arg)) arg++;
>
> skip_spaces?

skip_spaces would work fine.  Personally I don't like skip spaces
much; it's ugly code.  Heh, it is one of the few functions that would
look better as a macro ;) (the isspace would ensure type safety).
Skip spaces would work just as well though.  Doesn't much matter
either way.

#define skip_spaces(s) while(*(s) && isspace(*s)) (s)++

So skip_spaces(arg) instead of skip_spaces(&arg).

More or less a moot issue.  However, if you look at skip_spaces
definition, it's just ugly to look at.  Works just fine, but it's
painful on the eyes.

Elegance can be nice.  Certainly not saying the above code is
ellegant; just saying that skip_spaces isn't. ;)

--
James Turner               turnerjh@xtn.net
                           http://www.vuse.vanderbilt.edu/~turnerj1/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST