This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=194bf1e13885b55a7abf5b94fdceedbdbb0db606

commit 194bf1e13885b55a7abf5b94fdceedbdbb0db606
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Aug 25 03:52:55 2025 +0200

    Dpkg::Shlibs::SymbolFile: Switch wantarray from a ternary operator to 
if/else
    
    The current construct makes the code harder to read, reserve the
    ternary operator for very simple cases, and switch the current ones into
    proper if/else constructs.
---
 scripts/Dpkg/Shlibs/SymbolFile.pm | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm 
b/scripts/Dpkg/Shlibs/SymbolFile.pm
index b664dc52d..4b82ba1ac 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -400,8 +400,14 @@ sub find_matching_pattern {
            }
        }
        if (defined $pattern) {
-           return (wantarray) ?
-               ( symbol => $pattern, soname => $soname ) : $pattern;
+            if (wantarray) {
+                return (
+                    symbol => $pattern,
+                    soname => $soname,
+                );
+            } else {
+                return $pattern;
+            }
        }
     }
     return;
@@ -568,8 +574,14 @@ sub lookup_symbol {
            my $sym = $obj->{syms}{$name};
            if ($sym and ($inc_deprecated or not $sym->{deprecated}))
            {
-               return (wantarray) ?
-                   ( symbol => $sym, soname => $so ) : $sym;
+                if (wantarray) {
+                    return (
+                        symbol => $sym,
+                        soname => $so,
+                    );
+                } else {
+                    return $sym;
+                }
            }
        }
     }
@@ -603,8 +615,14 @@ sub lookup_pattern {
                    }
                }
                if ($pat && ($inc_deprecated || !$pat->{deprecated})) {
-                   return (wantarray) ?
-                       (symbol => $pat, soname => $soname) : $pat;
+                    if (wantarray) {
+                        return (
+                            symbol => $pat,
+                            soname => $soname,
+                        );
+                    } else {
+                        return $pat;
+                    }
                }
            }
        }

-- 
Dpkg.Org's dpkg

Reply via email to