From 17852f48a5325227d387d60c74d43f4bd2369142 Mon Sep 17 00:00:00 2001 From: emirpasic Date: Thu, 20 Sep 2018 17:44:34 +0200 Subject: [PATCH] - update documentation and comments --- README.md | 1 + lists/arraylist/arraylist_test.go | 2 +- lists/doublylinkedlist/doublylinkedlist.go | 2 +- lists/singlylinkedlist/singlylinkedlist.go | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cfcdb6c..492f373 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ type List interface { Sort(comparator utils.Comparator) Swap(index1, index2 int) Insert(index int, values ...interface{}) + Set(index int, value interface{}) containers.Container // Empty() bool diff --git a/lists/arraylist/arraylist_test.go b/lists/arraylist/arraylist_test.go index c4d9a7c..ced20c5 100644 --- a/lists/arraylist/arraylist_test.go +++ b/lists/arraylist/arraylist_test.go @@ -189,7 +189,7 @@ func TestListSet(t *testing.T) { if actualValue := list.Size(); actualValue != 3 { t.Errorf("Got %v expected %v", actualValue, 3) } - list.Set(4, "d") // ignore + list.Set(4, "d") // ignore list.Set(1, "bb") // update if actualValue := list.Size(); actualValue != 3 { t.Errorf("Got %v expected %v", actualValue, 3) diff --git a/lists/doublylinkedlist/doublylinkedlist.go b/lists/doublylinkedlist/doublylinkedlist.go index 836d867..97ddbad 100644 --- a/lists/doublylinkedlist/doublylinkedlist.go +++ b/lists/doublylinkedlist/doublylinkedlist.go @@ -293,7 +293,7 @@ func (list *List) Insert(index int, values ...interface{}) { } } -// Sets value at specified index position +// Set value at specified index position // Does not do anything if position is negative or bigger than list's size // Note: position equal to list's size is valid, i.e. append. func (list *List) Set(index int, value interface{}) { diff --git a/lists/singlylinkedlist/singlylinkedlist.go b/lists/singlylinkedlist/singlylinkedlist.go index 2d0f0bb..95eabd3 100644 --- a/lists/singlylinkedlist/singlylinkedlist.go +++ b/lists/singlylinkedlist/singlylinkedlist.go @@ -261,7 +261,7 @@ func (list *List) Insert(index int, values ...interface{}) { } } -// Sets value at specified index +// Set value at specified index // Does not do anything if position is negative or bigger than list's size // Note: position equal to list's size is valid, i.e. append. func (list *List) Set(index int, value interface{}) {