Merge pull request #177 from ligi/ligi/code_review/simplify_is_exist
simplify
This commit is contained in:
commit
0d6638e19b
|
@ -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;
|
||||
}
|
||||
accountState = repository.getAccountState(addr);
|
||||
return accountState != null && !accountState.isDeleted();
|
||||
|
||||
return exist;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue