Skip to content

Commit 01c3bae

Browse files
committed
Suppress some LGTM warnings.
1 parent c56ff10 commit 01c3bae

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/MySqlConnector/Core/CommandExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static async Task<DbDataReader> ExecuteReaderAsync(IReadOnlyList<IMySqlCo
5353
cancellationToken.ThrowIfCancellationRequested();
5454

5555
using var payload = writer.ToPayloadData();
56-
using var registration = command.CancellableCommand.RegisterCancel(cancellationToken);
56+
using var registration = command.CancellableCommand.RegisterCancel(cancellationToken); // lgtm[cs/useless-assignment-to-local]
5757
connection.Session.StartQuerying(command.CancellableCommand);
5858
command.SetLastInsertedId(-1);
5959
try

src/MySqlConnector/Core/ResultSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public async Task<bool> ReadAsync(IOBehavior ioBehavior, CancellationToken cance
210210
if (BufferState == ResultSetState.HasMoreData || BufferState == ResultSetState.NoMoreData || BufferState == ResultSetState.None)
211211
return new ValueTask<Row?>(default(Row?));
212212

213-
using var registration = Command.CancellableCommand.RegisterCancel(cancellationToken);
213+
using var registration = Command.CancellableCommand.RegisterCancel(cancellationToken); // lgtm[cs/useless-assignment-to-local]
214214
var payloadValueTask = Session.ReceiveReplyAsync(ioBehavior, CancellationToken.None);
215215
return payloadValueTask.IsCompletedSuccessfully
216216
? new ValueTask<Row?>(ScanRowAsyncRemainder(this, payloadValueTask.Result, row))

src/MySqlConnector/Core/SingleCommandPayloadCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private static bool WriteStoredProcedure(IMySqlCommand command, IDictionary<stri
152152
inParameters.Add(inParam);
153153
if (param.Direction == ParameterDirection.InputOutput)
154154
{
155-
inOutSetParameters += $"SET {outName}={inName}; ";
155+
inOutSetParameters += $"SET {outName}={inName}; "; // lgtm[cs/string-concatenation-in-loop]
156156
goto case ParameterDirection.Output;
157157
}
158158
argParameterNames.Add(inName);

src/MySqlConnector/Core/SqlParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ protected enum FinalParseStates
336336

337337
private static bool IsWhitespace(char ch) => ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
338338

339-
private static bool IsVariableName(char ch) => (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '.' || ch == '_' || ch == '$' || (ch >= 0x0080 && ch <= 0xFFFF);
339+
private static bool IsVariableName(char ch) => (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '.' || ch == '_' || ch == '$' || (ch >= 0x0080 && ch <= 0xFFFF); // lgtm[cs/constant-comparison]
340340

341341
private enum State
342342
{

src/MySqlConnector/Protocol/Payloads/InitialHandshakePayload.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public static InitialHandshakePayload Create(ReadOnlySpan<byte> span)
2626
var protocolCapabilities = (ProtocolCapabilities) reader.ReadUInt16();
2727
if (reader.BytesRemaining > 0)
2828
{
29-
var charSet = (CharacterSet) reader.ReadByte();
30-
var status = (ServerStatus) reader.ReadInt16();
29+
var charSet = (CharacterSet) reader.ReadByte(); // lgtm[cs/useless-assignment-to-local]
30+
var status = (ServerStatus) reader.ReadInt16(); // lgtm[cs/useless-assignment-to-local]
3131
var capabilityFlagsHigh = reader.ReadUInt16();
3232
protocolCapabilities |= (ProtocolCapabilities) ((ulong) capabilityFlagsHigh << 16);
3333
var authPluginDataLength = reader.ReadByte();
34-
var unused = reader.ReadByteString(6);
34+
reader.Offset += 6;
3535

3636
long extendedCapabilites = reader.ReadInt32();
3737
if ((protocolCapabilities & ProtocolCapabilities.LongPassword) == 0)

src/MySqlConnector/Protocol/Payloads/StatementPrepareResponsePayload.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static StatementPrepareResponsePayload Create(ReadOnlySpan<byte> span)
1717
var columnCount = (int) reader.ReadUInt16();
1818
var parameterCount = (int) reader.ReadUInt16();
1919
reader.ReadByte(0);
20-
var warningCount = (int) reader.ReadInt16();
20+
var warningCount = (int) reader.ReadInt16(); // lgtm[cs/useless-assignment-to-local]
2121

2222
return new StatementPrepareResponsePayload(statementId, columnCount, parameterCount);
2323
}

0 commit comments

Comments
 (0)