mirror of https://github.com/citusdata/citus.git
Refactoring to reduce nesting
parent
ae276e70ab
commit
de527dbb71
|
@ -621,10 +621,13 @@ ExtractTopComment(const char *inputString)
|
|||
|
||||
int commentEndCharsIndex = 0;
|
||||
|
||||
/* If query starts with a comment */
|
||||
if (inputString[commentEndCharsIndex] == '/' &&
|
||||
inputString[commentEndCharsIndex + 1] == '*')
|
||||
/* If query doesn't start with a comment, return NULL */
|
||||
if (inputString[commentEndCharsIndex] != '/' ||
|
||||
inputString[commentEndCharsIndex + 1] != '*')
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Skip the comment start characters */
|
||||
commentEndCharsIndex += commentStartCharsLength;
|
||||
while (commentEndCharsIndex < inputStringLen &&
|
||||
|
@ -633,7 +636,6 @@ ExtractTopComment(const char *inputString)
|
|||
{
|
||||
commentEndCharsIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
if (commentEndCharsIndex > commentStartCharsLength)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue