Commit 82455a41 by Aaron Gokaslan Committed by GitHub

Minor opt to cache tuple casting (#3894)

parent 2a7cb008
......@@ -647,8 +647,9 @@ private:
for (auto field : attr("fields").attr("items")()) {
auto spec = field.cast<tuple>();
auto name = spec[0].cast<pybind11::str>();
auto format = spec[1].cast<tuple>()[0].cast<dtype>();
auto offset = spec[1].cast<tuple>()[1].cast<pybind11::int_>();
auto spec_fo = spec[1].cast<tuple>();
auto format = spec_fo[0].cast<dtype>();
auto offset = spec_fo[1].cast<pybind11::int_>();
if ((len(name) == 0u) && format.kind() == 'V') {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment