Thread: New accounts
View Single Post
  #97  
Old 05-28-2008, 04:30 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Robin View Post
Jesus chompy what are you doing to me man, you scared the crap out of me.

Before you edited your post I had this in the quick reply box:

PHP Code:
function _getPlayer(pl) {
  
temp.findplayerbycommunityname(pl);
  if (
temp.== 0) {
    
temp.findplayer(pl);
    if (
temp.== 0) {
      return 
0;
    } else {
      return 
temp.p;
    }
  } else {
    return 
temp.p;
  }

[EDIT]
Actually that can probably be optimised:

PHP Code:
function _getPlayer(pl) {
  
temp.findplayerbycommunityname(pl);
  return 
== findplayer(pl) : p;

[/EDIT]
hehe


and, about your edit, that's not optimised though, as it does the same amount of checks .. linecount however is smaller
__________________