Skip to content

Commit cc58b1c

Browse files
committed
Remove unused return value.
1 parent 5758cb5 commit cc58b1c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/MySqlConnector/Core/SqlParser.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ namespace MySqlConnector.Core
55
{
66
internal abstract class SqlParser
77
{
8-
public int Parse(string sql)
8+
public void Parse(string sql)
99
{
1010
OnBeforeParse(sql ?? throw new ArgumentNullException(nameof(sql)));
1111

12-
int statementCount = 0;
1312
int parameterStartIndex = -1;
1413

1514
var state = State.Beginning;
@@ -148,7 +147,6 @@ public int Parse(string sql)
148147
}
149148
else if (ch == ';')
150149
{
151-
IncrementStatementCount(state, ref statementCount);
152150
state = State.Beginning;
153151
}
154152
else if (!IsWhitespace(ch) && state == State.Beginning)
@@ -158,9 +156,7 @@ public int Parse(string sql)
158156
}
159157
}
160158

161-
IncrementStatementCount(state, ref statementCount);
162159
OnParsed();
163-
return statementCount;
164160
}
165161

166162
protected virtual void OnBeforeParse(string sql)
@@ -178,13 +174,7 @@ protected virtual void OnNamedParameter(int index, int length)
178174
protected virtual void OnParsed()
179175
{
180176
}
181-
182-
private void IncrementStatementCount(State state, ref int statementCount)
183-
{
184-
if (state != State.Beginning && state != State.EndOfLineComment && state != State.CStyleComment && state != State.CStyleCommentAsterisk)
185-
statementCount++;
186-
}
187-
177+
188178
private static bool IsWhitespace(char ch) => ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
189179

190180
private static bool IsVariableName(char ch) => (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '.' || ch == '_' || ch == '$';

0 commit comments

Comments
 (0)