refactor(command): 'clear' logic refactor

This commit is contained in:
2026-03-04 11:08:27 +03:00
parent 2e4dbda68f
commit b2b1724705
2 changed files with 5 additions and 2 deletions

View File

@@ -12,7 +12,6 @@ class Clear(
override val description = "clear colletion" override val description = "clear colletion"
override fun execute(args: String) { override fun execute(args: String) {
collectionManager.getCollection().clear() collectionManager.clear()
io.println(collectionManager.getCollection().toString())
} }
} }

View File

@@ -35,4 +35,8 @@ class CollectionManager(
""" """
fun getCollection(): LinkedList<Product> = list fun getCollection(): LinkedList<Product> = list
fun clear() {
list.clear()
}
} }