Skip to content

Commit

Permalink
Simplify confirmPassCode
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 authored and AndyScherzinger committed Nov 1, 2023
1 parent a4bc2e7 commit 23097c8
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ private void processFullPassCode() {
savePassCodeAndExit();

} else {
showErrorAndRestart(
R.string.pass_code_mismatch, R.string.pass_code_configure_your_pass_code, View.VISIBLE
);
showErrorAndRestart(R.string.pass_code_mismatch, R.string.pass_code_configure_your_pass_code, View.VISIBLE);
}
}
}
Expand Down Expand Up @@ -318,11 +316,13 @@ protected boolean checkPassCode() {
protected boolean confirmPassCode() {
confirmingPassCode = false;

boolean result = true;
for (int i = 0; i < passCodeEditTexts.length && result; i++) {
result = passCodeEditTexts[i].getText().toString().equals(passCodeDigits[i]);
for (int i = 0; i < passCodeEditTexts.length; i++) {
Editable passCodeText = passCodeEditTexts[i].getText();
if (passCodeText == null || !passCodeText.toString().equals(passCodeDigits[i])) {
return false;
}
}
return result;
return true;
}

/**
Expand Down

0 comments on commit 23097c8

Please sign in to comment.