Ad
  • Custom User Avatar

    Good point. StringBuilder is the way to go. 10 months ago I didn't even know about SB :P

  • Custom User Avatar

    You make unnecessary calls to friends.length. This is never going to change throught the execution of this method, so to optimize your code you should define it as a variable in the beginning. You are basically making a function call to friends.length each iteration of the for loop as well as when defining your "ret" array. Just a heads up!