mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Minor opt to cache tuple casting (#3894)
This commit is contained in:
parent
2a7cb008ac
commit
82455a41fd
@ -647,8 +647,9 @@ private:
|
|||||||
for (auto field : attr("fields").attr("items")()) {
|
for (auto field : attr("fields").attr("items")()) {
|
||||||
auto spec = field.cast<tuple>();
|
auto spec = field.cast<tuple>();
|
||||||
auto name = spec[0].cast<pybind11::str>();
|
auto name = spec[0].cast<pybind11::str>();
|
||||||
auto format = spec[1].cast<tuple>()[0].cast<dtype>();
|
auto spec_fo = spec[1].cast<tuple>();
|
||||||
auto offset = spec[1].cast<tuple>()[1].cast<pybind11::int_>();
|
auto format = spec_fo[0].cast<dtype>();
|
||||||
|
auto offset = spec_fo[1].cast<pybind11::int_>();
|
||||||
if ((len(name) == 0u) && format.kind() == 'V') {
|
if ((len(name) == 0u) && format.kind() == 'V') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user