From 080d1e318db3bb4313385bb82afb0599893765e3 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 3 Apr 2021 21:04:43 +0200 Subject: [PATCH] Code improvement --- .../org/schabi/newpipe/extractor/downloader/Request.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java index 271f151c1..4bae8fc27 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java @@ -123,12 +123,10 @@ public class Request { * Any default headers that the implementation may have, should be overridden by these. */ public Builder headers(@Nullable Map> headers) { - if (headers == null) { - this.headers.clear(); - return this; - } this.headers.clear(); - this.headers.putAll(headers); + if (headers != null) { + this.headers.putAll(headers); + } return this; }