Skip to content

Commit

Permalink
Merge pull request #1849 from marcusnaslund/noabstractlist
Browse files Browse the repository at this point in the history
Reduced code duplication in Lists
  • Loading branch information
marcusnaslund authored Aug 1, 2016
2 parents f5b63ce + 1998b3a commit 8f136c2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions source/concurrent/SynchronizedList.ooc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ SynchronizedList: class <T> extends List<T> {
this _backend removeAt(index)
this _mutex unlock()
}
removeAt: override func ~range (range: Range) {
this removeAt(range min, range max)
}
removeAt: override func ~indices (start, end: Int) {
this _mutex lock()
this _backend removeAt(start, end)
Expand Down
4 changes: 2 additions & 2 deletions source/system/structs/List.ooc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ List: abstract class <T> {
insert: abstract func (index: Int, item: T)
remove: abstract func ~last -> T
remove: abstract func ~atIndex (index: Int) -> T
removeAt: abstract func (index: Int)
removeAt: abstract func ~range (range: Range)
removeAt: virtual func (index: Int) { this removeAt(index, index + 1) }
removeAt: func ~range (range: Range) { this removeAt(range min, range max) }
removeAt: abstract func ~indices (start, end: Int)
clear: abstract func
reverse: abstract func -> This<T>
Expand Down
2 changes: 0 additions & 2 deletions source/system/structs/VectorList.ooc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ VectorList: class <T> extends List<T>{
this _count -= 1
result
}
removeAt: override func (index: Int) { this removeAt(index, index + 1) }
removeAt: override func ~range (range: Range) { this removeAt(range min, range max) }
removeAt: override func ~indices (start, end: Int) {
count := end - start
version(safe)
Expand Down

0 comments on commit 8f136c2

Please sign in to comment.