提交 f83d6770 authored 作者: Travis Cross's avatar Travis Cross

Remove tautological conditional

If pattern is null we're setting it to a non-null value, so this
branch will always be taken.

Use `git diff -w` or `git log -p -w` to see what's going on in this
commit.
上级 1a71cf88
......@@ -177,6 +177,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
const char *do_break = switch_xml_attr_soft(input, "break_on_match");
char *field_expanded = NULL;
char *field_expanded_alloc = NULL;
switch_regex_t *re = NULL;
int proceed = 0, ovector[100];
switch_xml_t match = NULL;
searched = 1;
if (!field) {
......@@ -199,11 +202,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
pattern = ".*";
}
if (pattern) {
switch_regex_t *re = NULL;
int proceed = 0, ovector[100];
switch_xml_t match = NULL;
status = SWITCH_STATUS_SUCCESS;
if ((proceed = switch_regex_perform(field_expanded, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
......@@ -315,7 +313,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
switch_ivr_sleep(session, pause, SWITCH_FALSE, NULL);
switch_safe_free(expanded);
switch_safe_free(substituted);
}
}
......@@ -325,8 +322,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
break;
}
}
switch_safe_free(field_expanded_alloc);
if (status != SWITCH_STATUS_SUCCESS) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论