From d20262c62f27abe1f48daab72e795a7efc775bdc Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 19 Nov 2021 20:08:53 -0800 Subject: [PATCH] One minor lgtm fix --- .../java/com/ctc/wstx/dtd/FullDTDReader.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java b/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java index db33b032..5f7ded21 100644 --- a/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java +++ b/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java @@ -1662,22 +1662,17 @@ private void parseAttrDefaultValue(DefaultAttrValue defVal, char quoteChar, Pref // Ok, should have updated the input source by now continue main_loop; } - - if (c <= 0xFFFF) { - - } else{ - if (d <= 0xFFFF) { - c = (char) d; - } else { - // Need more room? - if (outPtr >= outBuf.length) { - outBuf = tb.finishCurrentSegment(); - outPtr = 0; - } - d -= 0x10000; - outBuf[outPtr++] = (char) ((d >> 10) + 0xD800);; - c = (char) ((d & 0x3FF) + 0xDC00); + if (d <= 0xFFFF) { + c = (char) d; + } else { + // Need more room? + if (outPtr >= outBuf.length) { + outBuf = tb.finishCurrentSegment(); + outPtr = 0; } + d -= 0x10000; + outBuf[outPtr++] = (char) ((d >> 10) + 0xD800);; + c = (char) ((d & 0x3FF) + 0xDC00); } } else if (c == '<') { throwDTDUnexpectedChar(c, SUFFIX_IN_DEF_ATTR_VALUE);