Ad
  • Custom User Avatar

    Because Unicode

  • Custom User Avatar

    Because Unicode

  • Custom User Avatar

    Never do that

  • Custom User Avatar

    var vectorMax = Vector<int>.Zero; but var vectorMax = Vector<int>(int.MinValue); should be, I think

    var blockVector = new Vector<int>(nums, blockIndex); copy memory

    vectorMax = Vector.Max(vectorMax, blockVector); copy memory

    2 memory coping. Is it faster then classic loop?

  • Custom User Avatar

    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.