[patch] global.c: Use VEC instead of VARRAY.
Nathan Sidwell
nathan@codesourcery.com
Sat Apr 23 16:16:00 GMT 2005
Kazu,
> What's the advantage of VEC_iterate? With checking enabled, I see
> that VEC_index won't perform a length check. Other than that, does it
> have other advantages? (I'm not saying that VEC_iterate is useless or
> anything. I just want to understand VEC_iterate.)
VEC_iterate is more mnemonic and less typing :) It essentially wraps up
a VEC_length and VEC_index call together. You should get the same assembly
out of both idioms. VEC_iterate is written so you can iterate in
either direction, btw.
Given its existance, when a loop doesn't use it, it makes me (at least)
wonder if something odd is going on.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
More information about the Gcc-patches
mailing list