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 <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-12-18 11:57:20 +09:00
parent fc07fa26b9
commit 38d42d5ccd
1 changed files with 2 additions and 4 deletions

View File

@ -573,10 +573,8 @@ public RefFilter getRefFilter() {
*/
public void setAdvertiseRefsHook(
@Nullable AdvertiseRefsHook advertiseRefsHook) {
if (advertiseRefsHook != null)
this.advertiseRefsHook = advertiseRefsHook;
else
this.advertiseRefsHook = AdvertiseRefsHook.DEFAULT;
this.advertiseRefsHook = advertiseRefsHook != null ? advertiseRefsHook
: AdvertiseRefsHook.DEFAULT;
}
/**