From eb1cefe2fa4dfc9c4a1e5ea6813cc202519918d3 Mon Sep 17 00:00:00 2001 From: mhmdanas <32234660+mhmdanas@users.noreply.github.com> Date: Sat, 15 May 2021 18:48:16 +0300 Subject: [PATCH] Make some minor changes --- app/src/main/java/org/schabi/newpipe/ktx/Throwable.kt | 6 ++---- .../schabi/newpipe/local/subscription/item/HeaderItem.kt | 2 +- .../main/java/org/schabi/newpipe/streams/WebMWriter.java | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ktx/Throwable.kt b/app/src/main/java/org/schabi/newpipe/ktx/Throwable.kt index b95f46fd4..63f1b2ab5 100644 --- a/app/src/main/java/org/schabi/newpipe/ktx/Throwable.kt +++ b/app/src/main/java/org/schabi/newpipe/ktx/Throwable.kt @@ -58,10 +58,8 @@ tailrec fun Throwable?.hasCause(checkSubtypes: Boolean, vararg causesToCheck: Cl if (causeClass.isAssignableFrom(this.javaClass)) { return true } - } else { - if (causeClass == this.javaClass) { - return true - } + } else if (causeClass == this.javaClass) { + return true } } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderItem.kt index e04164573..71c1e6116 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/HeaderItem.kt @@ -15,7 +15,7 @@ class HeaderItem( override fun bind(viewBinding: HeaderItemBinding, position: Int) { viewBinding.headerTitle.text = title - val listener: OnClickListener? = if (onClickListener != null) OnClickListener { onClickListener.invoke() } else null + val listener = onClickListener?.let { OnClickListener { onClickListener.invoke() } } viewBinding.root.setOnClickListener(listener) } diff --git a/app/src/main/java/org/schabi/newpipe/streams/WebMWriter.java b/app/src/main/java/org/schabi/newpipe/streams/WebMWriter.java index 55792d099..ebae3812c 100644 --- a/app/src/main/java/org/schabi/newpipe/streams/WebMWriter.java +++ b/app/src/main/java/org/schabi/newpipe/streams/WebMWriter.java @@ -712,7 +712,7 @@ public class WebMWriter implements Closeable { return 0; } - // TODO: in the adove code, find and select the shortest track for the desired kind + // TODO: in the above code, find and select the shortest track for the desired kind for (i = 0; i < infoTracks.length; i++) { if (kind == infoTracks[i].trackType) { return i;