Skip to content

Commit 080d1e3

Browse files
committed
Code improvement
1 parent 4ee270f commit 080d1e3

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • extractor/src/main/java/org/schabi/newpipe/extractor/downloader

extractor/src/main/java/org/schabi/newpipe/extractor/downloader/Request.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,10 @@ public Builder url(String url) {
123123
* Any default headers that the implementation may have, <b>should</b> be overridden by these.
124124
*/
125125
public Builder headers(@Nullable Map<String, List<String>> headers) {
126-
if (headers == null) {
127-
this.headers.clear();
128-
return this;
129-
}
130126
this.headers.clear();
131-
this.headers.putAll(headers);
127+
if (headers != null) {
128+
this.headers.putAll(headers);
129+
}
132130
return this;
133131
}
134132

0 commit comments

Comments
 (0)