Final note: In fact, it has been established (on this newsgroup as well as >> empirically by me and others) that if the indices are small integers, you
get sorting for free (in GAWK, which, as noted, is all we care about). So, >> you don't even really need to mess with PROCINFO[]...
Are you referring to the idea of just replacing the above for + if
structure with:
for (i in rank) {
}
and relying on the small integer indices being hashed in order?
Where is that documented? The manual reiterates that this is not
specified: "By default, the order in which a for (indx in array) loop
scans an array is not defined; it is generally based upon the internal >implementation of arrays inside awk."
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:41:33 |
Calls: | 10,390 |
Calls today: | 1 |
Files: | 14,064 |
Messages: | 6,417,072 |