mirror of https://github.com/citusdata/citus.git
Refactoring to reduce nesting
parent
8e1e827242
commit
486e2a622a
|
@ -691,10 +691,13 @@ 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] != '*')
|
||||||
{
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Skip the comment start characters */
|
/* Skip the comment start characters */
|
||||||
commentEndCharsIndex += commentStartCharsLength;
|
commentEndCharsIndex += commentStartCharsLength;
|
||||||
while (commentEndCharsIndex < inputStringLen &&
|
while (commentEndCharsIndex < inputStringLen &&
|
||||||
|
@ -703,7 +706,6 @@ ExtractTopComment(const char *inputString)
|
||||||
{
|
{
|
||||||
commentEndCharsIndex++;
|
commentEndCharsIndex++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (commentEndCharsIndex > commentStartCharsLength)
|
if (commentEndCharsIndex > commentStartCharsLength)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue