Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LastIndexOfAny< T >() [3/3]

static int System.SpanHelpers.LastIndexOfAny< T > ( ref T searchSpace,
T value0,
T value1,
T value2,
int length )
inlinestatic
Type Constraints
T :IEquatable<T> 

Definition at line 3652 of file SpanHelpers.cs.

3653 {
3654 if (default(T) != null || (value0 != null && value1 != null))
3655 {
3656 while (length >= 8)
3657 {
3658 length -= 8;
3659 T other = Unsafe.Add(ref searchSpace, length + 7);
3660 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3661 {
3662 other = Unsafe.Add(ref searchSpace, length + 6);
3663 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3664 {
3665 other = Unsafe.Add(ref searchSpace, length + 5);
3666 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3667 {
3668 other = Unsafe.Add(ref searchSpace, length + 4);
3669 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3670 {
3671 other = Unsafe.Add(ref searchSpace, length + 3);
3672 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3673 {
3674 other = Unsafe.Add(ref searchSpace, length + 2);
3675 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3676 {
3677 other = Unsafe.Add(ref searchSpace, length + 1);
3678 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3679 {
3681 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3682 {
3683 continue;
3684 }
3685 goto IL_047a;
3686 }
3687 goto IL_047d;
3688 }
3689 goto IL_0482;
3690 }
3691 goto IL_0487;
3692 }
3693 return length + 4;
3694 }
3695 return length + 5;
3696 }
3697 return length + 6;
3698 }
3699 return length + 7;
3700 }
3701 if (length >= 4)
3702 {
3703 length -= 4;
3704 T other = Unsafe.Add(ref searchSpace, length + 3);
3705 if (value0.Equals(other) || value1.Equals(other) || value2.Equals(other))
3706 {
3707 goto IL_0487;
3708 }
3709 other = Unsafe.Add(ref searchSpace, length + 2);
3710 if (value0.Equals(other) || value1.Equals(other) || value2.Equals(other))
3711 {
3712 goto IL_0482;
3713 }
3714 other = Unsafe.Add(ref searchSpace, length + 1);
3715 if (value0.Equals(other) || value1.Equals(other) || value2.Equals(other))
3716 {
3717 goto IL_047d;
3718 }
3720 if (value0.Equals(other) || value1.Equals(other) || value2.Equals(other))
3721 {
3722 goto IL_047a;
3723 }
3724 }
3725 while (length > 0)
3726 {
3727 length--;
3728 T other = Unsafe.Add(ref searchSpace, length);
3729 if (!value0.Equals(other) && !value1.Equals(other) && !value2.Equals(other))
3730 {
3731 continue;
3732 }
3733 goto IL_047a;
3734 }
3735 }
3736 else
3737 {
3738 for (length--; length >= 0; length--)
3739 {
3740 T other = Unsafe.Add(ref searchSpace, length);
3741 if (other == null)
3742 {
3743 if (value0 != null && value1 != null && value2 != null)
3744 {
3745 continue;
3746 }
3747 }
3748 else if (!other.Equals(value0) && !other.Equals(value1) && !other.Equals(value2))
3749 {
3750 continue;
3751 }
3752 goto IL_047a;
3753 }
3754 }
3755 return -1;
3756 IL_0482:
3757 return length + 2;
3758 IL_047d:
3759 return length + 1;
3760 IL_0487:
3761 return length + 3;
3762 IL_047a:
3763 return length;
3764 }

References System.length, and System.other.