Skip to content

Commit a974242

Browse files
authored
Merge pull request #208 from nstdio/remove-imaginary-optimizations
chore: Remove unnecessary field from DecompressingBodyHandler.
2 parents 8d6d30f + c420bcd commit a974242

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main/java/io/github/nstdio/http/ext/DecompressingBodyHandler.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class DecompressingBodyHandler<T> implements BodyHandler<T> {
4545
private final BodyHandler<T> original;
4646
private final Options options;
4747
private final boolean direct;
48-
private volatile List<String> directives;
4948

5049
DecompressingBodyHandler(BodyHandler<T> original, Options options) {
5150
this(Objects.requireNonNull(original), Objects.requireNonNull(options), false);
@@ -102,8 +101,6 @@ public BodySubscriber<T> apply(ResponseInfo info) {
102101
.stream()
103102
.reduce(IDENTITY, this::chain);
104103

105-
directives = List.copyOf(directiveToFn.keySet());
106-
107104
if (direct) {
108105
return directSubscriber(reduced);
109106
}
@@ -133,10 +130,7 @@ private Map<String, UnaryOperator<InputStream>> computeDirectives(HttpHeaders he
133130
}
134131

135132
List<String> directives(HttpHeaders headers) {
136-
if (directives != null)
137-
return directives;
138-
139-
return (directives = List.copyOf(computeDirectives(headers).keySet()));
133+
return List.copyOf(computeDirectives(headers).keySet());
140134
}
141135

142136
static class Options {

0 commit comments

Comments
 (0)