[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

1721: Re: [MUD-Dev] Languages

[Full Header] [Plain Text]
From: "Chris Gray" <cg@ami-cg.GraySage.Edmonton.AB.CA>
Newsgroups: nu.kanga.list.mud-dev
Date: Sun, 25 May 97 10:43:32 MST
Organization: Kanga.Nu
[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@ami-cg.GraySage.Edmonton.AB.CA