Skip to content

Commit

Permalink
Fix some code syle issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikarus23 committed Aug 31, 2024
1 parent 44561da commit 2037619
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ private void decodeValueBlocks() {
}
}

if (tmpVBs.size() > 0) {
if (!tmpVBs.isEmpty()) {
String[] vb = tmpVBs.toArray(new String[0]);
Intent intent = new Intent(this, ValueBlocksToInt.class);
intent.putExtra(ValueBlocksToInt.EXTRA_VB, vb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public void onCreateKeyMap(View view) {
fileNames.add(c.getText().toString());
}
}
if (fileNames.size() > 0) {
if (!fileNames.isEmpty()) {
// Check if key files still exists.
ArrayList<File> keyFiles = new ArrayList<>();
for (String fileName : fileNames) {
Expand All @@ -384,7 +384,7 @@ public void onCreateKeyMap(View view) {
+ "doesn't exists anymore.");
}
}
if (keyFiles.size() > 0) {
if (!keyFiles.isEmpty()) {
// Save last selected key files as "/"-separated string
// (if corresponding setting is active).
if (saveLastUsedKeyFiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ private void checkDumpAndShowSectorChooserDialog(final String[] dump) {
mDumpWithPos.remove(sector);
}
}
if (mDumpWithPos.size() == 0) {
if (mDumpWithPos.isEmpty()) {
// Error. There is nothing to write.
Toast.makeText(context, R.string.info_nothing_to_write,
Toast.LENGTH_LONG).show();
Expand Down Expand Up @@ -1147,7 +1147,7 @@ private void checkDumpAgainstTag() {
}

// Show skip/cancel dialog (if needed).
if (list.size() != 0) {
if (!list.isEmpty()) {
// If the user skips all sectors/blocks that are not writable,
// the writeTag() method will be called.
LinearLayout ll = new LinearLayout(this);
Expand Down Expand Up @@ -1222,7 +1222,7 @@ private void writeDump(
final HashMap<Integer, HashMap<Integer, Integer>> writeOnPos,
final SparseArray<byte[][]> keyMap) {
// Check for write data.
if (writeOnPos.size() == 0) {
if (writeOnPos.isEmpty()) {
// Nothing to write. Exit.
Toast.makeText(this, R.string.info_nothing_to_write,
Toast.LENGTH_LONG).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ private static String[] readLineByLine(BufferedReader reader,
Log.e(LOG_TAG, "Error while reading from file.", ex);
ret = null;
}
if (linesArray.size() > 0) {
if (!linesArray.isEmpty()) {
ret = linesArray.toArray(new String[0]);
} else {
ret = new String[]{""};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static SparseArray<Integer[][]> diffIndices(
diffIndices.add(k);
}
}
if (diffIndices.size() == 0) {
if (diffIndices.isEmpty()) {
// Block was identical.
diffSector[j] = new Integer[0];
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public HashMap<Integer, HashMap<Integer, Integer>> isWritableOnPositions(
}

}
if (blockWithWriteInfo.size() > 0) {
if (!blockWithWriteInfo.isEmpty()) {
ret.put(sector, blockWithWriteInfo);
}
}
Expand Down Expand Up @@ -845,7 +845,7 @@ public int setKeyFile(File[] keyFiles, Context context) {
}
}
}
if (keys.size() > 0) {
if (!keys.isEmpty()) {
mHasAllZeroKey = keys.contains("000000000000");
mKeysWithOrder = new ArrayList<>(keys);
if (mHasAllZeroKey) {
Expand Down

0 comments on commit 2037619

Please sign in to comment.