Botre 27 Share Posted December 16, 2014 No black pips please. (I have seen this kind of inefficiency a lot) Link to comment Share on other sites More sharing options...
Novak 35 Share Posted December 16, 2014 why are you returning a new integer again? Link to comment Share on other sites More sharing options...
Botre 27 Author Share Posted December 16, 2014 why are you returning a new integer again? Nein. Link to comment Share on other sites More sharing options...
Novak 35 Share 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 Link to comment Share on other sites More sharing options...
Botre 27 Author Share 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. Link to comment Share on other sites More sharing options...
Novak 35 Share 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 Link to comment Share on other sites More sharing options...
Explicit 213 Share 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? Link to comment Share on other sites More sharing options...
Botre 27 Author Share 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. Link to comment Share on other sites More sharing options...
Explicit 213 Share 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. Link to comment Share on other sites More sharing options...
Botre 27 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.