mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Add more review fixes for h3GetFaces
This commit is contained in:
parent
727182c3a4
commit
494c59d2c0
@ -60,29 +60,30 @@ public:
|
||||
auto & dst_data = dst->getData();
|
||||
auto & dst_offsets = dst->getOffsets();
|
||||
dst_offsets.resize(input_rows_count);
|
||||
auto current_offset = 0;
|
||||
|
||||
for (size_t row = 0 ; row < input_rows_count ; row++)
|
||||
auto current_offset = 0;
|
||||
std::vector<int> faces;
|
||||
|
||||
for (size_t row = 0; row < input_rows_count; row++)
|
||||
{
|
||||
int max_faces = maxFaceCount(data[row]);
|
||||
std::unique_ptr<int> faces(new int(max_faces));
|
||||
|
||||
faces.resize(max_faces);
|
||||
// function name h3GetFaces (v3.x) changed to getIcosahedronFaces (v4.0.0).
|
||||
getIcosahedronFaces(data[row], faces.get());
|
||||
getIcosahedronFaces(data[row], faces.data());
|
||||
|
||||
for (int i = 0; i < max_faces; i++)
|
||||
{
|
||||
// valid icosahedron faces are represented by integers 0-19
|
||||
auto iface = faces.get()[i];
|
||||
if (iface >= 0 && iface <= 19)
|
||||
if (faces[i] >= 0 && faces[i] <= 19)
|
||||
{
|
||||
++current_offset;
|
||||
dst_data.insert(iface);
|
||||
dst_data.insert(faces[i]);
|
||||
}
|
||||
}
|
||||
dst_offsets[row] = current_offset;
|
||||
faces.clear();
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
};
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
UInt8 res = isPentagon(data[row]);
|
||||
dst_data[row] = res;
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
};
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
UInt8 res = isResClassIII(data[row]);
|
||||
dst_data[row] = res;
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user