Re: Class.c

From: George Greer (greerga@circlemud.org)
Date: 06/21/02


On Fri, 21 Jun 2002, Dante Mavec wrote:

>> What comment?
>
>Just before int backstab_mult(int level)
>
>/*
> * This simply calculates the backstab multiplier based on a character's
> * level.  This used to be an array, but was changed to be a function so
> * that it would be easier to add more levels to your MUD.  This doesn't
> * really create a big performance hit because it's not used very often.
> */

But that's not a switch(), it's a bunch of if...else.  You were talking
about switch the language construct, or were you trying to be more broad?.
The switch statements are worse because they have large numbers of
different values while backstab_mult() just has a very few branches. And
backstab_mult() is used even less frequently the saving throws table.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT