Renamings

pull/6753/head
Gokhan Gulbiz 2023-03-16 10:54:07 +03:00
parent 05f90b30d3
commit c8ed4d174a
No known key found for this signature in database
GPG Key ID: 608EF06B6BD1B45B
1 changed files with 24 additions and 22 deletions

View File

@ -194,7 +194,8 @@ AttributeQueryIfAnnotated(const char *query_string, CmdType commandType)
strcpy_s(attributeToTenant, sizeof(attributeToTenant), tenantId); strcpy_s(attributeToTenant, sizeof(attributeToTenant), tenantId);
} }
colocationGroupId = ExtractFieldInt32(jsonbDatum, "cId", INVALID_COLOCATION_ID); colocationGroupId = ExtractFieldInt32(jsonbDatum, "cId",
INVALID_COLOCATION_ID);
if (MultiTenantMonitoringLogLevel != CITUS_LOG_LEVEL_OFF) if (MultiTenantMonitoringLogLevel != CITUS_LOG_LEVEL_OFF)
{ {
@ -675,21 +676,22 @@ Substring(const char *str, int start, int end)
static char * static char *
EscapeCommentChars(const char *str) EscapeCommentChars(const char *str)
{ {
int len = strlen(str); int originalStringLength = strlen(str);
char *new_str = (char *) malloc(len * 2 + 1); char *escapedString = (char *) malloc(originalStringLength * 2 + 1);
int j = 0; int escapedStringIndex = 0;
for (int i = 0; i < len; i++) for (int originalStringIndex = 0; originalStringIndex < originalStringLength;
originalStringIndex++)
{ {
if (str[i] == '*' || str[i] == '/') if (str[originalStringIndex] == '*' || str[originalStringIndex] == '/')
{ {
new_str[j++] = '\\'; escapedString[escapedStringIndex++] = '\\';
} }
new_str[j++] = str[i]; escapedString[escapedStringIndex++] = str[originalStringIndex];
} }
new_str[j] = '\0'; escapedString[escapedStringIndex] = '\0';
return new_str; return escapedString;
} }
@ -697,22 +699,22 @@ EscapeCommentChars(const char *str)
static char * static char *
UnescapeCommentChars(const char *str) UnescapeCommentChars(const char *str)
{ {
int len = strlen(str); int originalStringLength = strlen(str);
char *new_str = (char *) malloc(len + 1); char *unescapedString = (char *) malloc(originalStringLength + 1);
int j = 0; int unescapedStringIndex = 0;
for (int i = 0; i < len; i++) for (int originalStringindex = 0; originalStringindex < originalStringLength;
originalStringindex++)
{ {
if (str[i] == '\\' && i < len - 1) if (str[originalStringindex] == '\\' && originalStringindex <
originalStringLength - 1 && (str[originalStringindex + 1] == '*' ||
str[originalStringindex + 1] == '/'))
{ {
if (str[i + 1] == '*' || str[i + 1] == '/') originalStringindex++;
{
i++;
} }
unescapedString[unescapedStringIndex++] = str[originalStringindex];
} }
new_str[j++] = str[i]; unescapedString[unescapedStringIndex] = '\0';
}
new_str[j] = '\0';
return new_str; return unescapedString;
} }