Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
[O] General optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Dec 24, 2019
1 parent a0edbcf commit c8d0982
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/main/java/cc/moecraft/icq/user/GroupManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ public class GroupManager
*/
public Group getGroupFromID(long id)
{
if (groupCache.containsKey(id))
if (!groupCache.containsKey(id))
{
return groupCache.get(id);
groupCache.put(id, new Group(bot, id));
}
groupCache.put(id, new Group(bot, id));
return getGroupFromID(id);
return groupCache.get(id);
}
}
7 changes: 3 additions & 4 deletions src/main/java/cc/moecraft/icq/user/UserManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ public class UserManager
*/
public User getUserFromID(long id)
{
if (userCache.containsKey(id))
if (!userCache.containsKey(id))
{
return userCache.get(id);
userCache.put(id, new User(bot, id));
}
userCache.put(id, new User(bot, id));
return getUserFromID(id);
return userCache.get(id);
}
}

0 comments on commit c8d0982

Please sign in to comment.