refactor(command): 'clear' logic refactor
This commit is contained in:
@@ -12,7 +12,6 @@ class Clear(
|
||||
override val description = "clear colletion"
|
||||
|
||||
override fun execute(args: String) {
|
||||
collectionManager.getCollection().clear()
|
||||
io.println(collectionManager.getCollection().toString())
|
||||
collectionManager.clear()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,8 @@ class CollectionManager(
|
||||
"""
|
||||
|
||||
fun getCollection(): LinkedList<Product> = list
|
||||
|
||||
fun clear() {
|
||||
list.clear()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user