Simplify SWIGTYPE "in" typemap
There is no need to check if the input is non-null, as the effect of both branches of "if" is the same anyhow. Also get rid of an extra and unnecessary block. No real changes.
This commit is contained in:
parent
61e13eb42b
commit
fb0579a0df
1 changed files with 2 additions and 5 deletions
|
|
@ -190,12 +190,9 @@ same_action_all_primitive_types(in, "$1 = ($1_ltype) $input;", "$1 = &$input;")
|
|||
free($input);
|
||||
}
|
||||
|
||||
%typemap(in) SWIGTYPE & {
|
||||
if ($input)
|
||||
%typemap(in) SWIGTYPE & %{
|
||||
$1 = ($1_ltype) $input;
|
||||
else
|
||||
$1 = ($1_ltype) 0;
|
||||
}
|
||||
%}
|
||||
|
||||
// Typemaps for assigning result values to a special return variable
|
||||
same_action_all_primitive_types(out, "$result = $1;", "$result = *$1;")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue