Use switch/case very frequently to check which segment of code to be
executed is not efficient.
We can use Function pointer to link a generic function to the function that
needs to be executed. In the code, just call the generic function Thus
avoid the switch/case check. For an example, the generic function pointer
can be set to the address of different bond potential functions. Therefore,
we only need to set the address once and call the function pointer. This
should improve the performance.
Original issue reported on code.google.com by ywa...@gmail.com on 19 Jan 2008 at 2:22
Original issue reported on code.google.com by
ywa...@gmail.com
on 19 Jan 2008 at 2:22