Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
f067deb5
Unverified
Commit
f067deb5
authored
Jul 01, 2021
by
cyy
Committed by
GitHub
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid unnecessary strlen (#3058)
parent
733f8de2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
include/pybind11/attr.h
+1
-1
include/pybind11/pybind11.h
+1
-1
No files found.
include/pybind11/attr.h
View file @
f067deb5
...
@@ -377,7 +377,7 @@ template <> struct process_attribute<is_new_style_constructor> : process_attribu
...
@@ -377,7 +377,7 @@ template <> struct process_attribute<is_new_style_constructor> : process_attribu
};
};
inline
void
process_kw_only_arg
(
const
arg
&
a
,
function_record
*
r
)
{
inline
void
process_kw_only_arg
(
const
arg
&
a
,
function_record
*
r
)
{
if
(
!
a
.
name
||
strlen
(
a
.
name
)
==
0
)
if
(
!
a
.
name
||
a
.
name
[
0
]
==
'\0'
)
pybind11_fail
(
"arg(): cannot specify an unnamed argument after an kw_only() annotation"
);
pybind11_fail
(
"arg(): cannot specify an unnamed argument after an kw_only() annotation"
);
++
r
->
nargs_kw_only
;
++
r
->
nargs_kw_only
;
}
}
...
...
include/pybind11/pybind11.h
View file @
f067deb5
...
@@ -470,7 +470,7 @@ protected:
...
@@ -470,7 +470,7 @@ protected:
signatures
+=
it
->
signature
;
signatures
+=
it
->
signature
;
signatures
+=
"
\n
"
;
signatures
+=
"
\n
"
;
}
}
if
(
it
->
doc
&&
strlen
(
it
->
doc
)
>
0
&&
options
::
show_user_defined_docstrings
())
{
if
(
it
->
doc
&&
it
->
doc
[
0
]
!=
'\0'
&&
options
::
show_user_defined_docstrings
())
{
// If we're appending another docstring, and aren't printing function signatures, we
// If we're appending another docstring, and aren't printing function signatures, we
// need to append a newline first:
// need to append a newline first:
if
(
!
options
::
show_function_signatures
())
{
if
(
!
options
::
show_function_signatures
())
{
...
...
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