From 38d42d5ccd911a44ef789e71f0efcff0351eca85 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 18 Dec 2018 11:57:20 +0900 Subject: [PATCH] UploadPack: Rewrite setAdvertiseRefsHook to use ternary operator This makes the implementation consistent with the other similar methods in this class. Change-Id: I007876aad883615d696c8eabc886818ae00b10ee Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/transport/UploadPack.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 9d9005729..78bf0fe47 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -573,10 +573,8 @@ public class UploadPack { */ public void setAdvertiseRefsHook( @Nullable AdvertiseRefsHook advertiseRefsHook) { - if (advertiseRefsHook != null) - this.advertiseRefsHook = advertiseRefsHook; - else - this.advertiseRefsHook = AdvertiseRefsHook.DEFAULT; + this.advertiseRefsHook = advertiseRefsHook != null ? advertiseRefsHook + : AdvertiseRefsHook.DEFAULT; } /**