Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
82455a41
Unverified
Commit
82455a41
authored
Apr 24, 2022
by
Aaron Gokaslan
Committed by
GitHub
Apr 24, 2022
Browse files
Minor opt to cache tuple casting (#3894)
parent
2a7cb008
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
include/pybind11/numpy.h
include/pybind11/numpy.h
+3
-2
No files found.
include/pybind11/numpy.h
View file @
82455a41
...
@@ -647,8 +647,9 @@ private:
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment