Skip to content

Commit

Permalink
string builder
Browse files Browse the repository at this point in the history
  • Loading branch information
AshyBoxy committed Oct 15, 2024
1 parent 72a7a38 commit 2ff0e5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/xyz/ashyboxy/Uwuifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ public static String uwuifyHashed(String str) {

private static String puncGen(String punc, String alt, int maxLen, int minLen, float altChance) {
int count = rand.nextInt(maxLen - minLen) + minLen;
String result = "";
StringBuilder result = new StringBuilder();
for (int i = 0; i < count; i++) {
if (rand.nextFloat() < altChance)
result += alt;
result.append(alt);
else
result += punc;
result.append(punc);
}
return result;
return result.toString();
}

private static class Punc {
Expand Down

0 comments on commit 2ff0e5a

Please sign in to comment.