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