[MUD-Dev] Languages

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Sun May 25 10:43:32 CEST 1997


[Jeff K:]

I promised myself not to touch this language debate anymore, but
:byte *t1,t2;
:
:...
:for (i=0;i<length;i++) *t1++ = *t2++;
:
:or something simialr?
:
:Such array walkign is MUCh faster then array access with [], but yould
:never guess that unless you understood what C is doing.

Any C compiler optimizer worth its salt will turn the [] form into the
pointer form. And perhaps even into a 'memcpy' call for your example.

That's a *lot* harder to do in C++ if you have redefined '[]', however!

--
Chris Gray   cg at ami-cg.GraySage.Edmonton.AB.CA



More information about the mud-dev-archive mailing list