File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
cbor/src/main/java/tools/jackson/dataformat/cbor Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2434,8 +2434,11 @@ private final String _finishShortText(int len) throws JacksonException
24342434 i = inputBuf [inPtr ++];
24352435 outBuf [outPtr ++] = (char ) i ;
24362436 }
2437- if (inPtr == end && i >= 0 ) {
2438- String str = _textBuffer .setCurrentAndReturn (outPtr );
2437+ if (inPtr == end && i >= 0 ) { // all ASCII
2438+ // 25-Oct-2025: [dataformats-binary#624] Minor optimization: can directly
2439+ // construct String; faster in JDK 17+
2440+ //String str = _textBuffer.setCurrentAndReturn(outPtr);
2441+ String str = _textBuffer .resetWithASCII (inputBuf , inPtr -len , len );
24392442 if (stringRefs != null ) {
24402443 stringRefs .stringRefs .add (str );
24412444 _sharedString = str ;
You can’t perform that action at this time.
0 commit comments