Skip to content

Commit a1f3b67

Browse files
committed
Use target-typed new.
1 parent 06cabf7 commit a1f3b67

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/MySqlConnector/Core/IValuesEnumerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal sealed class DataReaderValuesEnumerator : IValuesEnumerator
4141

4242
public int FieldCount => m_dataReader.FieldCount;
4343

44-
public ValueTask<bool> MoveNextAsync() => new ValueTask<bool>(MoveNext());
44+
public ValueTask<bool> MoveNextAsync() => new(MoveNext());
4545

4646
public bool MoveNext() => m_dataReader.Read();
4747

@@ -63,7 +63,7 @@ public DataRowsValuesEnumerator(IEnumerable<DataRow> dataRows, int columnCount)
6363

6464
public int FieldCount { get; }
6565

66-
public ValueTask<bool> MoveNextAsync() => new ValueTask<bool>(MoveNext());
66+
public ValueTask<bool> MoveNextAsync() => new(MoveNext());
6767

6868
public bool MoveNext()
6969
{

src/MySqlConnector/MySqlCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ internal Task<MySqlDataReader> ExecuteReaderNoResetTimeoutAsync(CommandBehavior
319319
return CommandExecutor.ExecuteReaderAsync(new IMySqlCommand[] { this }, SingleCommandPayloadCreator.Instance, behavior, ioBehavior, cancellationToken);
320320
}
321321

322-
public MySqlCommand Clone() => new MySqlCommand(this);
322+
public MySqlCommand Clone() => new(this);
323323

324324
#if !NETSTANDARD1_3
325325
object ICloneable.Clone() => Clone();

src/MySqlConnector/MySqlConnection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,14 @@ public override Task<DataTable> GetSchemaAsync(string collectionName, string?[]
607607
/// </summary>
608608
/// <returns></returns>
609609
public MySqlBatch CreateBatch() => CreateDbBatch();
610-
private MySqlBatch CreateDbBatch() => new MySqlBatch(this);
610+
private MySqlBatch CreateDbBatch() => new(this);
611611

612612
/// <summary>
613613
/// Creates a <see cref="MySqlBatchCommand"/> object (that can be used with <see cref="MySqlBatch.BatchCommands"/>).
614614
/// </summary>
615615
/// <returns></returns>
616616
public MySqlBatchCommand CreateBatchCommand() => CreateDbBatchCommand();
617-
private MySqlBatchCommand CreateDbBatchCommand() => new MySqlBatchCommand();
617+
private MySqlBatchCommand CreateDbBatchCommand() => new();
618618
public bool CanCreateBatch => true;
619619

620620
protected override void Dispose(bool disposing)
@@ -647,7 +647,7 @@ public override async ValueTask DisposeAsync()
647647
}
648648
}
649649

650-
public MySqlConnection Clone() => new MySqlConnection(m_connectionString, m_hasBeenOpened);
650+
public MySqlConnection Clone() => new(m_connectionString, m_hasBeenOpened);
651651

652652
#if !NETSTANDARD1_3
653653
object ICloneable.Clone() => Clone();

0 commit comments

Comments
 (0)