Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Aug 17, 2023
1 parent 6c71f89 commit 1a8ed33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
5 changes: 2 additions & 3 deletions src/nanoarrow/buffer_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ static inline int64_t _ArrowBytesForBits(int64_t bits) {
return (bits >> 3) + ((bits & 7) != 0);
}

static inline void _ArrowBitmapUnpackInt8(const uint8_t* bits, int8_t* out) {
const uint8_t word = *bits;
static inline void _ArrowBitmapUnpackInt8(const uint8_t word, int8_t* out) {
out[0] = (word >> 0) & 1;
out[1] = (word >> 1) & 1;
out[2] = (word >> 2) & 1;
Expand Down Expand Up @@ -277,7 +276,7 @@ static inline void ArrowBitmapUnpackInt8Unsafe(const uint8_t* bits, int64_t star

// middle bytes
for (int64_t i = bytes_begin + 1; i < bytes_last_valid; i++) {
_ArrowBitmapUnpackInt8(&bits[i], out);
_ArrowBitmapUnpackInt8(bits[i], out);
out += 8;
}

Expand Down
22 changes: 0 additions & 22 deletions src/nanoarrow/buffer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,28 +290,6 @@ TEST(BitmapTest, BitmapTestBitmapUnpackInt8Unsafe) {
EXPECT_EQ(result[i], 1);
}

bitmap[2] = 0xfd;
ArrowBitmapUnpackInt8Unsafe(bitmap, 0, sizeof(result), result);
EXPECT_EQ(result[16 + 0], 1);
EXPECT_EQ(result[16 + 1], 0);
EXPECT_EQ(result[16 + 2], 1);
EXPECT_EQ(result[16 + 3], 1);
EXPECT_EQ(result[16 + 4], 1);
EXPECT_EQ(result[16 + 5], 1);
EXPECT_EQ(result[16 + 6], 1);
EXPECT_EQ(result[16 + 7], 1);

bitmap[2] = 0x02;
ArrowBitmapUnpackInt8Unsafe(bitmap, 0, sizeof(result), result);
EXPECT_EQ(result[16 + 0], 0);
EXPECT_EQ(result[16 + 1], 1);
EXPECT_EQ(result[16 + 2], 0);
EXPECT_EQ(result[16 + 3], 0);
EXPECT_EQ(result[16 + 4], 0);
EXPECT_EQ(result[16 + 5], 0);
EXPECT_EQ(result[16 + 6], 0);
EXPECT_EQ(result[16 + 7], 0);

bitmap[0] = 0x93; // 10010011
bitmap[1] = 0x55; // 01010101
bitmap[2] = 0xaa; // 10101010
Expand Down

0 comments on commit 1a8ed33

Please sign in to comment.