Skip to content

Commit 9c99f86

Browse files
committed
Remove utfDecoder, which was unused.
1 parent 529af2e commit 9c99f86

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

reader/src/main/java/com/maxmind/db/Decoder.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import java.lang.reflect.InvocationTargetException;
77
import java.lang.reflect.ParameterizedType;
88
import java.math.BigInteger;
9-
import java.nio.charset.Charset;
10-
import java.nio.charset.CharsetDecoder;
119
import java.nio.charset.StandardCharsets;
1210
import java.util.ArrayList;
1311
import java.util.HashMap;
@@ -22,8 +20,6 @@
2220
*/
2321
final class Decoder {
2422

25-
private static final Charset UTF_8 = StandardCharsets.UTF_8;
26-
2723
private static final int[] POINTER_VALUE_OFFSETS = {0, 0, 1 << 11, (1 << 19) + (1 << 11), 0};
2824

2925
// XXX - This is only for unit testings. We should possibly make a
@@ -34,8 +30,6 @@ final class Decoder {
3430

3531
private final long pointerBase;
3632

37-
private final CharsetDecoder utfDecoder = UTF_8.newDecoder();
38-
3933
private final ByteReader buffer;
4034

4135
private final ConcurrentHashMap<Class, CachedConstructor> constructors;
@@ -194,7 +188,7 @@ private <T> Object decodeByType(
194188
}
195189

196190
private String decodeString(int size) {
197-
return new String(buffer.getBytes(size), UTF_8);
191+
return new String(buffer.getBytes(size), StandardCharsets.UTF_8);
198192
}
199193

200194
private int decodeUint16(int size) {

0 commit comments

Comments
 (0)