File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/java/dev/morling/onebrc Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,10 @@ public static List<WeatherStation> getWeatherStationsList(long seed) throws Exce
8383 var nameBuf = new StringBuilder (nameLen );
8484 nameBuf .append (buf , 0 , nameLen );
8585
86- if (Character .isWhitespace (nameBuf .charAt (0 ))) {
86+ while (Character .isWhitespace (nameBuf .charAt (0 ))) {
8787 nameBuf .setCharAt (0 , readNonSpace (nameSource ));
8888 }
89- if (Character .isWhitespace (nameBuf .charAt (nameBuf .length () - 1 ))) {
89+ while (Character .isWhitespace (nameBuf .charAt (nameBuf .length () - 1 ))) {
9090 nameBuf .setCharAt (nameBuf .length () - 1 , readNonSpace (nameSource ));
9191 }
9292
@@ -141,7 +141,7 @@ private static char readNonSpace(StringReader nameSource) throws Exception {
141141 throw new Exception ("Name source exhausted" );
142142 }
143143 c = (char ) n ;
144- } while (c == ' ' );
144+ } while (Character . isWhitespace ( c ) );
145145
146146 return c ;
147147 }
You can’t perform that action at this time.
0 commit comments