isaacs/node-lru-cache — pull request #9 by jldailey (2012-09-04 15:04:28+00:00)
Title: Corrected improvements.

Freek Zindel sent along some helpful code review comments that lruWalk actually doesn't do anything, because 'lru' is never used once it gets set.

Since trim() does all the real work, I applied the same basic optimization (avoiding the potentially large temporary array) to the loop inside trim(); along with removing all the unused code.

This removes the temporary array, but does add a call to hasOwnProperty for loop safety. If you trust we are not in a world of savages (who really extends Object.prototype anymore?), then it could be avoided.