You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/09/12 12:59:35 UTC
(commons-imaging) 12/22: Merge nested if clauses
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
commit 6ca068cca31cdb40809d7422bae29a329f02ddbd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Sep 12 08:58:06 2024 -0400
Merge nested if clauses
---
.../apache/commons/imaging/formats/png/PngImageParser.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
index f21761f5..24c11f14 100644
--- a/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
@@ -242,10 +242,8 @@ public class PngImageParser extends AbstractImageParser<PngImagingParameters> im
gammaCorrection = new GammaCorrection(gamma, targetGamma);
}
- if (gammaCorrection != null) {
- if (pngChunkPLTE != null) {
- pngChunkPLTE.correct(gammaCorrection);
- }
+ if (gammaCorrection != null && pngChunkPLTE != null) {
+ pngChunkPLTE.correct(gammaCorrection);
}
}
@@ -633,10 +631,8 @@ public class PngImageParser extends AbstractImageParser<PngImagingParameters> im
BinaryFunctions.skipBytes(is, length, "Not a Valid PNG File");
}
- if (LOGGER.isLoggable(Level.FINEST)) {
- if (bytes != null) {
- debugNumber("bytes", bytes.length, 4);
- }
+ if (LOGGER.isLoggable(Level.FINEST) && bytes != null) {
+ debugNumber("bytes", bytes.length, 4);
}
final int crc = BinaryFunctions.read4Bytes("CRC", is, "Not a Valid PNG File", getByteOrder());