You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sodonnel (via GitHub)" <gi...@apache.org> on 2024/11/08 12:17:00 UTC
[PR] HDDS-11669. In OmUtils.normalizeKey isDebugEnabled should be evaluated first [ozone]
sodonnel opened a new pull request, #7411:
URL: https://github.com/apache/ozone/pull/7411
## What changes were proposed in this pull request?
In `OmUtils.normalizeKey()`, the code:
```
if (!keyName.equals(normalizedKeyName) && LOG.isDebugEnabled()) {
LOG.debug("Normalized key {} to {} ", keyName,
normalizedKeyName.substring(1));
}
```
Always executes the `String.equals()`, but it does not do anything unless debug is enabled.
Debug should be first in the if statement as predicates are evaluated left to right and if isDebugEnabled returns false, the more expensive string compare will not execute.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11669
## How was this patch tested?
Existing tests.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11669. In OmUtils.normalizeKey isDebugEnabled should be evaluated first [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #7411:
URL: https://github.com/apache/ozone/pull/7411#issuecomment-2464978201
Thansk @sodonnel for the patch.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11669. In OmUtils.normalizeKey isDebugEnabled should be evaluated first [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #7411:
URL: https://github.com/apache/ozone/pull/7411
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org