[Asterisk-code-review] cel/cel pgsql.c: Use the 'SEP' macro when appending a column... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu May 14 05:02:14 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: cel/cel_pgsql.c: Use the 'SEP' macro when appending a column name
......................................................................


cel/cel_pgsql.c: Use the 'SEP' macro when appending a column name

When appending a column name to the sql buffer, the predicate, "if first is
non-null, use empty string; else, use comma", is identical to the 'SEP' macro
definition. Since they are the same, this patch replaces the redundant
predicate statement with the 'SEP' macro.

Change-Id: Ib8b6138b06a48381723108a05ab8752cb8700509
---
M cel/cel_pgsql.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ashley Sanders: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c
index 2d7f0df..bc76b27 100644
--- a/cel/cel_pgsql.c
+++ b/cel/cel_pgsql.c
@@ -201,7 +201,7 @@
 		AST_RWLIST_RDLOCK(&psql_columns);
 		AST_RWLIST_TRAVERSE(&psql_columns, cur, list) {
 			LENGTHEN_BUF1(strlen(cur->name) + 2);
-			ast_str_append(&sql, 0, "%s\"%s\"", first ? "" : ",", cur->name);
+			ast_str_append(&sql, 0, "%s\"%s\"", SEP, cur->name);
 
 			if (strcmp(cur->name, "eventtime") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {

-- 
To view, visit https://gerrit.asterisk.org/460
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib8b6138b06a48381723108a05ab8752cb8700509
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Rodrigo Ramirez Norambuena <decipher.hk at gmail.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list