You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/11/08 12:18:00 UTC
[jira] [Updated] (HDDS-11669) In OmUtils.normalizeKey isDebugEnabled should be evaluated first
[ https://issues.apache.org/jira/browse/HDDS-11669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HDDS-11669:
----------------------------------
Labels: pull-request-available (was: )
> In OmUtils.normalizeKey isDebugEnabled should be evaluated first
> ----------------------------------------------------------------
>
> Key: HDDS-11669
> URL: https://issues.apache.org/jira/browse/HDDS-11669
> Project: Apache Ozone
> Issue Type: Improvement
> Components: OM
> Reporter: Stephen O'Donnell
> Assignee: Stephen O'Donnell
> Priority: Major
> Labels: pull-request-available
>
> In OmUtils.normalizeKey(), the code:
> {code}
> if (!keyName.equals(normalizedKeyName) && LOG.isDebugEnabled()) {
> LOG.debug("Normalized key {} to {} ", keyName,
> normalizedKeyName.substring(1));
> }
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org