mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-10-03 23:53:15 -04:00
Changes suggested by Intellij in the category "Performance".
Updated.
This commit is contained in:
@@ -54,6 +54,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
@@ -196,7 +197,7 @@ public final class BMPImageReader extends ImageReaderBase {
|
||||
checkBounds(pImageIndex);
|
||||
|
||||
// TODO: Better implementation, include INT_RGB types for 3BYTE_BGR and 4BYTE_ABGR for INT_ARGB
|
||||
return Arrays.asList(getRawImageType(pImageIndex)).iterator();
|
||||
return Collections.singletonList(getRawImageType(pImageIndex)).iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -78,6 +78,7 @@ import java.awt.image.*;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -181,7 +182,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
||||
readPICTHeader0(pStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void readPICTHeader0(final ImageInputStream pStream) throws IOException {
|
||||
// Get size
|
||||
picSize = pStream.readUnsignedShort();
|
||||
@@ -325,7 +326,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
||||
|
||||
/**
|
||||
* Reads the PICT stream.
|
||||
* The contents of the stream will be drawn onto the supplied graphics
|
||||
* The contents of the stream will be drawn onto the supplied graphics
|
||||
* object.
|
||||
* <p>
|
||||
* If "DEBUG" is true, the elements read are listed on stdout.
|
||||
@@ -510,7 +511,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
||||
ovSize.setLocation(x, y);
|
||||
/*
|
||||
ovSize.x *= 2;// Don't know why, but has to be multiplied by 2
|
||||
|
||||
|
||||
ovSize.y *= 2;
|
||||
*/
|
||||
if (DEBUG) {
|
||||
@@ -2627,7 +2628,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
||||
|
||||
public Iterator<ImageTypeSpecifier> getImageTypes(int pIndex) throws IOException {
|
||||
// TODO: The images look slightly different in Preview.. Could indicate the color space is wrong...
|
||||
return Arrays.asList(
|
||||
return Collections.singletonList(
|
||||
ImageTypeSpecifiers.createPacked(
|
||||
ColorSpace.getInstance(ColorSpace.CS_sRGB),
|
||||
0xff0000, 0xff00, 0xff, 0xff000000, DataBuffer.TYPE_INT, false
|
||||
|
Reference in New Issue
Block a user