Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization suggestion for org.slf4j.helpers.MessageFormatter.arrayFormat(String, Object[], Throwable) #435

Open
dukeware opened this issue Oct 7, 2024 · 0 comments

Comments

@dukeware
Copy link

dukeware commented Oct 7, 2024

In order to reduce unnecessary expenses:

deeplyAppendParameter(sbuf, argArray[L], new HashMap<>());

should be:

deeplyAppendParameter(sbuf, argArray[L], null);

Correspondingly, in org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(StringBuilder, Object, Map<Object[], Object>)

objectArrayAppend(sbuf, (Object[]) o, seenMap);

change to:

objectArrayAppend(sbuf, (Object[]) o, seenMap != null ? seenMap : new HashMap<>());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant