FasterXML / jackson-core

Core part of Jackson that defines Streaming API as well as basic shared abstractions
Apache License 2.0
2.25k stars 773 forks source link

Remove duplicated condition #1279

Closed Philzen closed 4 months ago

Philzen commented 4 months ago

Haven't checked the bytecode if this would be optimized away by the compiler or not – so cannot say whether this would also pose a nice micro-optimization.

However it simplifies the condition and reduces the code base.

Kindly advise if this is the right target branch for the PR.

cowtowncoder commented 4 months ago

I don't plan for new releases of 2.15 so this should be rebased for 2.18 (current default).

EDIT: has really no practical performance effect since it's in readResolved() that'd be used for JDK deserialization. But I guess it's one less line of code, cleaner... will review. (and fwtw I suspect JIT would not optimize it away)

Philzen commented 4 months ago

… so this should be rebased for 2.18 (current default).

Done.

cowtowncoder commented 4 months ago

LGTM, will merge. Thank you @Philzen !