paulirwin commented on code in PR #1079:
URL: https://github.com/apache/lucenenet/pull/1079#discussion_r2354127420
##########
src/Lucene.Net/Store/CompoundFileDirectory.cs:
##########
@@ -131,10 +131,10 @@ public CompoundFileDirectory(Directory directory, string
fileName, IOContext con
}
// LUCENENET NOTE: These MUST be sbyte because they can be negative
- private static readonly sbyte CODEC_MAGIC_BYTE1 =
(sbyte)(CodecUtil.CODEC_MAGIC >>> 24);
- private static readonly sbyte CODEC_MAGIC_BYTE2 =
(sbyte)(CodecUtil.CODEC_MAGIC >>> 16);
- private static readonly sbyte CODEC_MAGIC_BYTE3 =
(sbyte)(CodecUtil.CODEC_MAGIC >>> 8);
- private static readonly sbyte CODEC_MAGIC_BYTE4 =
(sbyte)CodecUtil.CODEC_MAGIC;
+ private const sbyte CODEC_MAGIC_BYTE1 = (sbyte)(CodecUtil.CODEC_MAGIC
>>> 24);
Review Comment:
When this is added, Rider/ReSharper's static code analysis gives this
warning: "Unchecked context is redundant: no operators or conversions with
overflow checks" - resolving this as "won't fix."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]