On Sunday, 29 April 2012 at 08:20:59 UTC, Jonathan M Davis wrote:
The compiler doesn't necessarily know that foo won't remove key from aa, so it can't save the result of key in aa to reuse rather than calling aa[key], whereas the programmer could know that foo doesn't do anything to aa which would make a pointer to the element invalid and can guarantee that only one
lookup occurs by doing
[…]

Yes, point taken, but what does this have to do with locality?

David

Reply via email to