Skip to content

Commit

Permalink
StringBuilder for String concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
MetatransApps committed Dec 5, 2024
1 parent c73d397 commit dd4f3b9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion EnginesRunner/src/bagaturchess/datagen/Main_DataGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ private void writeGame(IBitBoard bitboard, List<Integer> moves, List<Integer> ev

positions++;

String line = bitboard.toEPD() + " | " + eval + " | " + result;
StringBuilder sb = new StringBuilder(20 + bitboard.toEPD().length());

sb.append(bitboard.toEPD())
.append(" | ")
.append(eval)
.append(" | ")
.append(result);

String line = sb.toString();

bw.write(line);
bw.newLine();
Expand Down

0 comments on commit dd4f3b9

Please sign in to comment.