From 756f33ad9a9f35a5cf3287dcb8fce7bb94c52972 Mon Sep 17 00:00:00 2001 From: emirpasic Date: Sat, 7 Mar 2015 18:26:03 +0100 Subject: [PATCH] - cleanup reference in remove method of array list --- lists/arraylist/arraylist.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lists/arraylist/arraylist.go b/lists/arraylist/arraylist.go index e994022..3e3f13f 100644 --- a/lists/arraylist/arraylist.go +++ b/lists/arraylist/arraylist.go @@ -82,6 +82,7 @@ func (list *List) Remove(index int) { return } + list.elements[index] = nil // cleanup reference copy(list.elements[index:], list.elements[index+1:list.size]) // shift to the left by one (slow operation, need ways to optimize this) list.size -= 1