Skip to content

Commit ae77ff9

Browse files
committed
Move values declaration in getDouble and getFloat
1 parent 3fdf3fa commit ae77ff9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/maxmind/db/MultiBuffer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ public double getDouble() {
149149
int off = (int) (position % CHUNK_SIZE);
150150
ByteBuffer buf = buffers.get(bufIndex);
151151
buf.position(off);
152-
double value;
153152
if (buf.remaining() >= 8) {
154-
value = buf.getDouble();
153+
double value = buf.getDouble();
155154
position += 8;
156155
return value;
157156
} else {
@@ -168,9 +167,8 @@ public float getFloat() {
168167
int off = (int) (position % CHUNK_SIZE);
169168
ByteBuffer buf = buffers.get(bufIndex);
170169
buf.position(off);
171-
float value;
172170
if (buf.remaining() >= 4) {
173-
value = buf.getFloat();
171+
float value = buf.getFloat();
174172
position += 4;
175173
return value;
176174
} else {

0 commit comments

Comments
 (0)