Skip to content

Commit 0100f84

Browse files
performance: remove unneeded ToArray calls
1 parent 00b1023 commit 0100f84

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Dapper.SqlBuilder/SqlBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public string ResolveClauses(DynamicParameters p)
4848
.Union(new[]
4949
{
5050
" ( " +
51-
string.Join(" OR ", this.Where(a => a.IsInclusive).Select(c => c.Sql).ToArray()) +
51+
string.Join(" OR ", this.Where(a => a.IsInclusive).Select(c => c.Sql)) +
5252
" ) "
53-
}).ToArray()) + _postfix
54-
: _prefix + string.Join(_joiner, this.Select(c => c.Sql).ToArray()) + _postfix;
53+
})) + _postfix
54+
: _prefix + string.Join(_joiner, this.Select(c => c.Sql)) + _postfix;
5555
}
5656
}
5757

Dapper/DynamicParameters.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,10 @@ static void ThrowInvalidChain()
397397
}
398398
while (diving is not null);
399399

400-
var dynamicParamName = string.Concat(names.ToArray());
400+
var dynamicParamName = string.Concat(names);
401401

402402
// Before we get all emitty...
403-
var lookup = string.Join("|", names.ToArray());
403+
var lookup = string.Join("|", names);
404404

405405
var cache = CachedOutputSetters<T>.Cache;
406406
var setter = (Action<object, DynamicParameters>?)cache[lookup];

0 commit comments

Comments
 (0)