You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2015/11/24 00:06:18 UTC
trafficserver git commit: TS-4038: remove redundant isdigit() call
Repository: trafficserver
Updated Branches:
refs/heads/master 730bd80dd -> 74c7e40b2
TS-4038: remove redundant isdigit() call
`isdigit(b)` is called redundantly in `LogFormat::parse_escape_string(const
char*, int)`. Simple fix that shouldn't have any side effects since
isdigit is not changing the value of b. This closes #347.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/74c7e40b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/74c7e40b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/74c7e40b
Branch: refs/heads/master
Commit: 74c7e40b251ce165f92a28053ea41141fb1af153
Parents: 730bd80
Author: Can Selcik <cs...@linkedin.com>
Authored: Mon Nov 23 12:05:20 2015 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Nov 23 15:01:36 2015 -0800
----------------------------------------------------------------------
proxy/logging/LogFormat.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/74c7e40b/proxy/logging/LogFormat.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFormat.cc b/proxy/logging/LogFormat.cc
index 4d0abff..e1b1fae 100644
--- a/proxy/logging/LogFormat.cc
+++ b/proxy/logging/LogFormat.cc
@@ -570,7 +570,7 @@ LogFormat::parse_escape_string(const char *str, int len)
b = (unsigned char)str[start + 2];
c = (unsigned char)str[start + 3];
- if (isdigit(a) && isdigit(b) && isdigit(b)) {
+ if (isdigit(a) && isdigit(b)) {
sum = (a - '0') * 64 + (b - '0') * 8 + (c - '0');
if (sum == 0 || sum >= 255) {