GitHub user rgs1 opened a pull request:
https://github.com/apache/zookeeper/pull/38
refactor(ClientCnxn): no need to gate cheap LOG.debug calls
If building the parameters for LOG.debug is cheap, there is
no point in cluttering the code with if (LOG.isDebugEnabled)
gates.
Thus, this removes the gating when parameters are cheap. Also,
some small grammar nits are taken care of plus a few changes
of extrapolation instead of concatenation.
Note that for hot paths, where we don't want to be creating
many strings, the if (LOG.isDebugEnabled) is left untouched.
Besides the small variations in the strings, nothing else
should change.
Signed-off-by: Raul Gutierrez S <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rgs1/zookeeper
remove-is-debug-enabled-when-call-is-cheap
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/38.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #38
----
commit 4d13c3402bdfd8d445496c20b0e286594fdd5021
Author: Raul Gutierrez S <[email protected]>
Date: 2015-07-13T03:19:20Z
refactor(ClientCnxn): no need to gate cheap LOG.debug calls
If building the parameters for LOG.debug is cheap, there is
no point in cluttering the code with if (LOG.isDebugEnabled)
gates.
Thus, this removes the gating when parameters are cheap. Also,
some small grammar nits are taken care of plus a few changes
of extrapolation instead of concatenation.
Note that for hot paths, where we don't want to be creating
many strings, the if (LOG.isDebugEnabled) is left untouched.
Besides the small variations in the strings, nothing else
should change.
Signed-off-by: Raul Gutierrez S <[email protected]>
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---