I want my map to be as efficient as possible in the basic code (not worrying about systems here, just plain Jass). I've searched around for tips on this but am not completely sure what the pros/cons are of the following snippets of code. Would someone mind pointing out the pros/cons of each of the following in terms of efficiency? Thanks.

Thanks guys that's most helpful. I didn't mention that I need the array elsewhere so, given that I have to have the array set anyway, would that make A better than B?

The difference between A and B would amount to the difference in the weight of two coins of the same denomination selected at random.

The secret to truly fast JASS code: reduce function calls to a minimum. The only places where Truly Fast JASS™ will make any kind of noticeable difference will be in iterative or recursive shit which recurses/iterates a large number of times. Trying to optimize a function that's called maybe once every 5 seconds will sooner drive you insane then it will actually make any kind of measurable difference.

It's not that it's well known, it's just that people have learned not to care about it. I mean, sure, we sometimes give people a hard time about petty efficiency improvements in the submission section but that's usually only the case when we don't like their spell in general, not because we would think having one less local declaration will dramatically improve the speed of the spell.