pidl:NDR/Parser: simplify logic in ParseMemCtxPullFlags()
authorStefan Metzmacher <metze@samba.org>
Tue, 21 Sep 2010 01:48:09 +0000 (03:48 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 28 Sep 2010 21:06:49 +0000 (23:06 +0200)
metze

pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm

index 7f958ab71ca8c451c32cdda28a23d5eb62c5a686..b5393613f688d57012724c2b87461af4211444ca 100644 (file)
@@ -951,12 +951,10 @@ sub ParseMemCtxPullFlags($$$$)
 
        if (($l->{TYPE} eq "POINTER") and ($l->{POINTER_TYPE} eq "ref")) {
                my $nl = GetNextLevel($e, $l);
-               my $next_is_array = ($nl->{TYPE} eq "ARRAY");
-               my $next_is_string = (($nl->{TYPE} eq "DATA") and 
-                                       ($nl->{DATA_TYPE} eq "string"));
-               if ($next_is_array or $next_is_string) {
-                       return undef;
-               } elsif ($l->{LEVEL} eq "TOP") {
+               return undef if ($nl->{TYPE} eq "ARRAY");
+               return undef if (($nl->{TYPE} eq "DATA") and ($nl->{DATA_TYPE} eq "string"));
+
+               if ($l->{LEVEL} eq "TOP") {
                        $mem_flags = "LIBNDR_FLAG_REF_ALLOC";
                }
        }