1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-14 16:15:41 +00:00

[ci skip] perf: convert Count to for loop with index access

This commit is contained in:
Oliver Booth 2023-03-30 20:21:29 +01:00
parent 76810408f2
commit 006523d342
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025

View File

@ -30,8 +30,9 @@ public static class SpanExtensions
{ {
var count = 0; var count = 0;
foreach (T item in source) for (var index = 0; index < source.Length; index++)
{ {
T item = source[index];
if (item.Equals(element)) if (item.Equals(element))
{ {
count++; count++;