if (items == null || items.Length == 0) C# compiler makes check on null them self, so if (items.Length == 0) is enought. max = items[i].CompareTo(max) > 0 ? items[i] : max; is slower then if (max.CompareTo(items[i]) < 0) max = items[i];
I love var more then T because code can be copied and paste to another place without changing.
Because Unicode
Because Unicode
Never do that
var vectorMax = Vector<int>.Zero;
butvar vectorMax = Vector<int>(int.MinValue);
should be, I thinkvar blockVector = new Vector<int>(nums, blockIndex);
copy memoryvectorMax = Vector.Max(vectorMax, blockVector);
copy memory2 memory coping. Is it faster then classic loop?
if (items == null || items.Length == 0)
C# compiler makes check on null them self, soif (items.Length == 0)
is enought.max = items[i].CompareTo(max) > 0 ? items[i] : max;
is slower thenif (max.CompareTo(items[i]) < 0) max = items[i];
I love
var
more thenT
because code can be copied and paste to another place without changing.