Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
merykitty committed Jan 30, 2024
1 parent 428faeb commit dd6460b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ private static long iterate(PoorManMap aggrMap, MemorySegment data, long offset)

// Find the delimiter ';'
long semicolons = line.compare(VectorOperators.EQ, ';').toLong();
int keySize = Long.numberOfTrailingZeros(semicolons);

// If we cannot find the delimiter in the vector, that means the key is
// longer than the vector, fall back to scalar processing
if (keySize == BYTE_SPECIES.vectorByteSize()) {
if (semicolons == 0) {
int keySize = BYTE_SPECIES.length();
while (data.get(ValueLayout.JAVA_BYTE, offset + keySize) != ';') {
keySize++;
}
Expand All @@ -240,6 +240,7 @@ private static long iterate(PoorManMap aggrMap, MemorySegment data, long offset)
}

// We inline the searching of the value in the hash map
int keySize = Long.numberOfTrailingZeros(semicolons);
int x;
int y;
if (keySize >= Integer.BYTES) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,18 +356,18 @@ private static PoorManMap processFile(MemorySegment data, long offset, long limi
long end0 = base + limit0;
long end1 = base + limit1;
while (true) {
boolean finishes = false;
boolean finish = false;
if (begin0 < end0) {
begin0 = iterate(aggrMap, begin0);
}
else {
finishes = true;
finish = true;
}
if (begin1 < end1 - mainLoopMinWidth) {
begin1 = iterate(aggrMap, begin1);
}
else {
if (finishes) {
if (finish) {
break;
}
}
Expand Down

0 comments on commit dd6460b

Please sign in to comment.