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: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,075 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 94:47:58 |
| Calls: | 13,798 |
| Calls today: | 1 |
| Files: | 186,989 |
| D/L today: |
6,337 files (1,800M bytes) |
| Messages: | 2,438,405 |