https://kotlinlang.org logo
#codereview
Title
# codereview
s

smilecs

03/02/2018, 2:02 PM
k

kingsley

03/02/2018, 3:38 PM
So many nullability going on in there. I believe you can slim fit a couple of them For example, if carts were indeed loaded, then
onKartLoaded
shouldn’t take a nullable parameter. If you are sure an item will be in a map, you can consider
map.getValue(key)
, which returns a non-null result, instead of using
map[key]
Indeed, I would move most of this logic to the presenter, and only callback the view with an already processed
List<X>
You could consider the no-arg plugin to avoid unnecessary defaults in class declaration I suppose you could replace
amount = amount.plus(someValue)
with
amount += someValue
onKartLoaded
definitely should be broken into smaller independent functions if possible And finally, you just might be able to take more advantage of functional operations on those collections to make everything look much cleaner
d

dave08

03/04/2018, 3:29 PM
s

smilecs

03/04/2018, 3:46 PM
alright, will do so now
3 Views