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:
Vadim Zeitlin 2019-08-04 15:23:35 +02:00
commit fb0579a0df

View file

@ -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;")