cleanup: remove unnecessary boxing
This commit is contained in:
@@ -49,7 +49,7 @@ public class BuddyList {
|
||||
|
||||
public boolean contains(int characterId) {
|
||||
synchronized(buddies) {
|
||||
return buddies.containsKey(Integer.valueOf(characterId));
|
||||
return buddies.containsKey(characterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class BuddyList {
|
||||
|
||||
public BuddylistEntry get(int characterId) {
|
||||
synchronized(buddies) {
|
||||
return buddies.get(Integer.valueOf(characterId));
|
||||
return buddies.get(characterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ public class BuddyList {
|
||||
|
||||
public void put(BuddylistEntry entry) {
|
||||
synchronized(buddies) {
|
||||
buddies.put(Integer.valueOf(entry.getCharacterId()), entry);
|
||||
buddies.put(entry.getCharacterId(), entry);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(int characterId) {
|
||||
synchronized(buddies) {
|
||||
buddies.remove(Integer.valueOf(characterId));
|
||||
buddies.remove(characterId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SkillFactory {
|
||||
|
||||
public static Skill getSkill(int id) {
|
||||
if (!skills.isEmpty()) {
|
||||
return skills.get(Integer.valueOf(id));
|
||||
return skills.get(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -21,14 +21,15 @@
|
||||
*/
|
||||
package client.inventory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Danny (Leifde)
|
||||
@@ -39,7 +40,7 @@ public class PetDataFactory {
|
||||
private static Map<Integer, Integer> petHunger = new HashMap<Integer, Integer>();
|
||||
|
||||
public static PetCommand getPetCommand(int petId, int skillId) {
|
||||
PetCommand ret = petCommands.get(Integer.valueOf(petId) + "" + skillId);
|
||||
PetCommand ret = petCommands.get(petId + "" + skillId);
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
@@ -61,14 +62,14 @@ public class PetDataFactory {
|
||||
}
|
||||
|
||||
public static int getHunger(int petId) {
|
||||
Integer ret = petHunger.get(Integer.valueOf(petId));
|
||||
Integer ret = petHunger.get(petId);
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
synchronized (petHunger) {
|
||||
ret = petHunger.get(Integer.valueOf(petId));
|
||||
ret = petHunger.get(petId);
|
||||
if (ret == null) {
|
||||
ret = Integer.valueOf(MapleDataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1));
|
||||
ret = MapleDataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user