Merge pull request #177 from ligi/ligi/code_review/simplify_is_exist

simplify
This commit is contained in:
skype me: roman.mandeleil 2014-12-25 11:06:10 +02:00
commit 0d6638e19b
1 changed files with 3 additions and 7 deletions

View File

@ -69,16 +69,12 @@ public class RepositoryTrack implements Repository {
@Override
public boolean isExist(byte[] addr) {
boolean exist = false;
AccountState accountState = cacheAccounts.get(wrap(addr));
if (accountState != null && !accountState.isDeleted()) exist = true;
if (accountState != null) return !accountState.isDeleted();
if (accountState == null){
accountState = repository.getAccountState(addr);
if (accountState != null && !accountState.isDeleted()) exist = true;
}
return accountState != null && !accountState.isDeleted();
return exist;
}