Skip to content

Commit b903186

Browse files
committed
minor clean up
1 parent 3150d6b commit b903186

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

netty-utils/src/main/java/org/asynchttpclient/netty/util/Utf8ByteBufCharsetDecoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,17 @@ public String decode(ByteBuf... bufs) throws CharacterCodingException {
182182

183183
int totalSize = 0;
184184
int totalNioBuffers = 0;
185-
boolean direct = false;
185+
boolean withoutArray = false;
186186
for (ByteBuf buf : bufs) {
187-
if (buf.isDirect()) {
188-
direct = true;
187+
if (!buf.hasArray()) {
188+
withoutArray = true;
189189
break;
190190
}
191191
totalSize += buf.readableBytes();
192192
totalNioBuffers += buf.nioBufferCount();
193193
}
194194

195-
if (direct) {
195+
if (withoutArray) {
196196
return ByteBufUtils.decodeNonOptimized(UTF_8, bufs);
197197

198198
} else {

0 commit comments

Comments
 (0)