aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMarko Topolnik <marko.topolnik@gmail.com>2024-01-05 22:39:28 +0100
committerGunnar Morling <gunnar.morling@googlemail.com>2024-01-06 10:35:44 +0100
commita094d07925f33bf30a028ee77bd8c28417ed3301 (patch)
treeb88d2e1dafbe023e9bd08f3bc0840898f9a20853 /src/main/java
parentd7456c6ff9ec8da2e038b00c2af75ce8da56be12 (diff)
Move attribution into weather_stations.csv
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/dev/morling/onebrc/CreateMeasurements3.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/dev/morling/onebrc/CreateMeasurements3.java b/src/main/java/dev/morling/onebrc/CreateMeasurements3.java
index 65589da..23b1b74 100644
--- a/src/main/java/dev/morling/onebrc/CreateMeasurements3.java
+++ b/src/main/java/dev/morling/onebrc/CreateMeasurements3.java
@@ -69,8 +69,8 @@ public class CreateMeasurements3 {
// Use a public list of city names and concatenate them all into a long string,
// which we'll use as a "source of city name randomness"
var bigName = new StringBuilder(1 << 20);
- // Source: https://simplemaps.com/data/world-cities
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"));) {
+ rows.readLine(); // Skip the attribution line
while (true) {
var row = rows.readLine();
if (row == null) {
@@ -84,6 +84,7 @@ public class CreateMeasurements3 {
var minLen = Integer.MAX_VALUE;
var maxLen = Integer.MIN_VALUE;
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"))) {
+ rows.readLine(); // Skip the attribution line
final var nameSource = new StringReader(bigName.toString());
final var buf = new char[MAX_NAME_LEN];
final var rnd = ThreadLocalRandom.current();