File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
day08/src/main/java/de/havox_design/aoc2015/day08 Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ plugins {
44
55// project meta data
66group ' de.havox_design.aoc2015'
7- version ' 0.9.0 '
7+ version ' 0.9.1 '
88
99// Switch to gradle "all" distribution.
1010wrapper {
Original file line number Diff line number Diff line change @@ -82,15 +82,16 @@ private static int inMemoryLength(String line) {
8282 }
8383
8484 private static int encodedLength (String line ) {
85- String encodedString = "\\ \" " ;
85+ StringBuilder builder = new StringBuilder ();
86+ builder .append ("\\ \" " );
8687 for (int i = 1 ; i < line .length (); i ++) {
8788 if (line .charAt (i ) == '\\' || line .charAt (i ) == '"' ) {
88- encodedString += "\\ " ;
89+ builder . append ( "\\ " ) ;
8990 }
90- encodedString += line .charAt (i );
91+ builder . append ( line .charAt (i ) );
9192 }
92- encodedString += "\\ \" " ;
93- return encodedString .length ();
93+ builder . append ( "\\ \" " ) ;
94+ return builder . toString () .length ();
9495 }
9596
9697 private List <String > readData (String fileName ) {
You can’t perform that action at this time.
0 commit comments