mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Use var instead of explicit types
This commit is contained in:
parent
03c30519b1
commit
de273586b4
77 changed files with 850 additions and 1017 deletions
|
@ -10,7 +10,7 @@ public class Util {
|
|||
}
|
||||
|
||||
public static String getStringIfNotBlank(Optional<String> value) {
|
||||
String string = value.orNull();
|
||||
var string = value.orNull();
|
||||
if (string == null || string.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ public class Util {
|
|||
}
|
||||
|
||||
public static String formatSafetyNumber(String digits) {
|
||||
final int partCount = 12;
|
||||
int partSize = digits.length() / partCount;
|
||||
StringBuilder f = new StringBuilder(digits.length() + partCount);
|
||||
for (int i = 0; i < partCount; i++) {
|
||||
final var partCount = 12;
|
||||
var partSize = digits.length() / partCount;
|
||||
var f = new StringBuilder(digits.length() + partCount);
|
||||
for (var i = 0; i < partCount; i++) {
|
||||
f.append(digits, i * partSize, (i * partSize) + partSize).append(" ");
|
||||
}
|
||||
return f.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue