Removed surplus type casting from nxt_memcmp() calls.
This commit is contained in:
@@ -613,9 +613,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end,
|
||||
return nxt_conf_json_parse_string(pos, end, value, pool);
|
||||
|
||||
case 't':
|
||||
if (nxt_fast_path(end - pos >= 4
|
||||
|| nxt_memcmp(pos, (u_char *) "true", 4) == 0))
|
||||
{
|
||||
if (nxt_fast_path(end - pos >= 4 || nxt_memcmp(pos, "true", 4) == 0)) {
|
||||
value->u.boolean = 1;
|
||||
value->type = NXT_CONF_JSON_BOOLEAN;
|
||||
|
||||
@@ -625,9 +623,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end,
|
||||
return NULL;
|
||||
|
||||
case 'f':
|
||||
if (nxt_fast_path(end - pos >= 5
|
||||
|| nxt_memcmp(pos, (u_char *) "false", 5) == 0))
|
||||
{
|
||||
if (nxt_fast_path(end - pos >= 5 || nxt_memcmp(pos, "false", 5) == 0)) {
|
||||
value->u.boolean = 0;
|
||||
value->type = NXT_CONF_JSON_BOOLEAN;
|
||||
|
||||
@@ -637,9 +633,7 @@ nxt_conf_json_parse_value(u_char *pos, u_char *end,
|
||||
return NULL;
|
||||
|
||||
case 'n':
|
||||
if (nxt_fast_path(end - pos >= 4
|
||||
|| nxt_memcmp(pos, (u_char *) "null", 4) == 0))
|
||||
{
|
||||
if (nxt_fast_path(end - pos >= 4 || nxt_memcmp(pos, "null", 4) == 0)) {
|
||||
value->type = NXT_CONF_JSON_NULL;
|
||||
return pos + 4;
|
||||
}
|
||||
|
||||
@@ -913,7 +913,7 @@ nxt_runtime_sockaddr_parse(nxt_task_t *task, nxt_mp_t *mp, nxt_str_t *addr)
|
||||
length = addr->length;
|
||||
p = addr->start;
|
||||
|
||||
if (length >= 5 && nxt_memcmp(p, (u_char *) "unix:", 5) == 0) {
|
||||
if (length >= 5 && nxt_memcmp(p, "unix:", 5) == 0) {
|
||||
return nxt_runtime_sockaddr_unix_parse(task, mp, addr);
|
||||
}
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ nxt_job_sockaddr_parse(nxt_job_sockaddr_parse_t *jbs)
|
||||
length = jbs->addr.length;
|
||||
p = jbs->addr.start;
|
||||
|
||||
if (length > 6 && nxt_memcmp(p, (u_char *) "unix:", 5) == 0) {
|
||||
if (length > 6 && nxt_memcmp(p, "unix:", 5) == 0) {
|
||||
ret = nxt_job_sockaddr_unix_parse(jbs);
|
||||
|
||||
} else if (length != 0 && *p == '[') {
|
||||
|
||||
Reference in New Issue
Block a user