- if (exists $param->{$opt}) {
- $res->{$opt} = $param->{$opt};
- } elsif (!exists $res->{$opt}) {
- raise_param_exc({
- "$opt" => 'Not passed as parameter and not defined in realm default sync options.'
- }) if !$fmt->{optional};
- $res->{$opt} = $fmt->{default} if exists $fmt->{default};
- }
+ $res->{$opt} = $param->{$opt} // $defaults->{$opt} // $fmt->{default};
+ raise_param_exc({
+ "$opt" => 'Not passed as parameter and not defined in realm default sync options.'
+ }) if !defined($res->{$opt});