Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
32a6613e
Commit
32a6613e
authored
Oct 25, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
container/list: elide redundant tests and fix comment typo
R=dsymonds CC=golang-dev
https://golang.org/cl/2700041
parent
01389b96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
src/pkg/container/list/list.go
src/pkg/container/list/list.go
+2
-8
No files found.
src/pkg/container/list/list.go
View file @
32a6613e
...
...
@@ -11,7 +11,7 @@ type Element struct {
// The front of the list has prev = nil, and the back has next = nil.
next
,
prev
*
Element
// Th
i
e list to which this element belongs.
// The list to which this element belongs.
list
*
List
// The contents of this list element.
...
...
@@ -40,7 +40,7 @@ func (l *List) Init() *List {
}
// New returns an initialized list.
func
New
()
*
List
{
return
new
(
List
)
.
Init
()
}
func
New
()
*
List
{
return
new
(
List
)
}
// Front returns the first element in the list.
func
(
l
*
List
)
Front
()
*
Element
{
return
l
.
front
}
...
...
@@ -127,9 +127,6 @@ func (l *List) insertBack(e *Element) {
// PushFront inserts the value at the front of the list and returns a new Element containing the value.
func
(
l
*
List
)
PushFront
(
value
interface
{})
*
Element
{
if
l
==
nil
{
l
.
Init
()
}
e
:=
&
Element
{
nil
,
nil
,
l
,
value
}
l
.
insertFront
(
e
)
return
e
...
...
@@ -137,9 +134,6 @@ func (l *List) PushFront(value interface{}) *Element {
// PushBack inserts the value at the back of the list and returns a new Element containing the value.
func
(
l
*
List
)
PushBack
(
value
interface
{})
*
Element
{
if
l
==
nil
{
l
.
Init
()
}
e
:=
&
Element
{
nil
,
nil
,
l
,
value
}
l
.
insertBack
(
e
)
return
e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment