[Jython-checkins] jython: Trim the list in gc.get_objects() as the hinted size may be wasteful

darjus.loktevic jython-checkins at python.org
Mon Jan 4 21:40:08 EST 2016


https://hg.python.org/jython/rev/cbd991011dd5
changeset:   7850:cbd991011dd5
user:        Darjus Loktevic <darjus at gmail.com>
date:        Tue Jan 05 13:40:00 2016 +1100
summary:
  Trim the list in gc.get_objects() as the hinted size may be wasteful

files:
  src/org/python/modules/gc.java |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/src/org/python/modules/gc.java b/src/org/python/modules/gc.java
--- a/src/org/python/modules/gc.java
+++ b/src/org/python/modules/gc.java
@@ -2580,6 +2580,7 @@
                 }
             }
         }
+        resultList.trimToSize();
         return new PyList(resultList);
     }
 

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list