[webkit-reviews] review granted: [Bug 67823] [NRWT] Provides a simple LRU cache class in Python. : [Attachment 108278] fix_leak

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 22 10:11:29 PDT 2011


Tony Chang <tony at chromium.org> has granted Hayato Ito <hayato at chromium.org>'s
request for review:
Bug 67823: [NRWT] Provides a simple LRU cache class in Python.
https://bugs.webkit.org/show_bug.cgi?id=67823

Attachment 108278: fix_leak
https://bugs.webkit.org/attachment.cgi?id=108278&action=review

------- Additional Comments from Tony Chang <tony at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=108278&action=review


> Tools/Scripts/webkitpy/common/lru_cache.py:32
> +class Node():
> +    def __init__(self, key, value):
> +	   self.key = key
> +	   self.value = value
> +	   self.prev = None
> +	   self.next = None

Nit: You can save a bit of memory by making prev and next class variables. 
E.g.:
class Node():
  prev = None
  next = None
  def __init__(self, key, value):
    self.key = key
    self.value = value


More information about the webkit-reviews mailing list