Botre 27 Posted December 16, 2014 No black pips please. (I have seen this kind of inefficiency a lot)
Novak 35 Posted December 16, 2014 Nein. i dont understand tho... object : new Integer(1337) would return the same values, no? so whether is null or not its still returning 1337
Botre 27 Author Posted December 16, 2014 i dont understand tho... object : new Integer(1337) would return the same values, no? so whether is null or not its still returning 1337 Unless you set "object" to any of the 4 billion other int values it can hold, or to any other object.
Novak 35 Posted December 16, 2014 Unless you set "object" to any of the 4 billion other int values it can hold, or to any other object. but you didn't I'm out of ideas now, I'm going to work
Explicit 213 Posted December 16, 2014 "object" can never be null (unless set within a different instance method) so the ternary in the getter is pointless (in this case). How is this inefficient?
Botre 27 Author Posted December 16, 2014 "object" can never be null (unless set within a different instance method) so the ternary in the getter is pointless (in this case). How is this inefficient? *gives medal* redundant (double) check = redundant processing = inefficient.
Explicit 213 Posted December 16, 2014 *gives medal* redundant (double) check = redundant processing = inefficient. But it's not, considering anyone working with your code could add an instance method #fuckWithBotre and set "object" to null.
Botre 27 Author Posted December 16, 2014 But it's not, considering anyone working with your code could add an instance method #fuckWithBotre and set "object" to null.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.