682 {
683 byte b = (byte)((!PathInternal.IsDirectorySeparator(first[
first.Length - 1]) && !PathInternal.IsDirectorySeparator(second[0])) ? 1 : 0);
684 byte b2 = (byte)((!PathInternal.IsDirectorySeparator(second[
second.Length - 1]) && !PathInternal.IsDirectorySeparator(third[0])) ? 1 : 0);
685 byte b3 = (byte)((!PathInternal.IsDirectorySeparator(third[
third.Length - 1]) && !PathInternal.IsDirectorySeparator(fourth[0])) ? 1 : 0);
687 {
689 {
691 {
693 {
694 Join4Payload join4Payload =
new Join4Payload(first2,
first.Length, second2,
second.Length, third2,
third.Length, fourth2, fourth.
Length, (
byte)(b | (b2 << 1) | (b3 << 2)));
695 return string.Create(
first.Length +
second.Length +
third.Length + fourth.
Length + b + b2 + b3, (IntPtr)(&join4Payload), delegate(Span<char>
destination, IntPtr statePtr)
696 {
697 ref Join4Payload reference = ref *(Join4Payload*)(void*)statePtr;
698 new Span<char>(reference.First, reference.FirstLength).CopyTo(
destination);
699 int firstLength = reference.FirstLength;
700 if (((uint)reference.Separators & (true ? 1u : 0u)) != 0)
701 {
703 }
704 new Span<char>(reference.Second, reference.SecondLength).CopyTo(
destination.Slice(firstLength));
705 firstLength += reference.SecondLength;
706 if ((reference.Separators & 2u) != 0)
707 {
709 }
710 new Span<char>(reference.Third, reference.ThirdLength).CopyTo(
destination.Slice(firstLength));
711 firstLength += reference.ThirdLength;
712 if ((reference.Separators & 4u) != 0)
713 {
715 }
716 new Span<char>(reference.Fourth, reference.FourthLength).CopyTo(
destination.Slice(firstLength));
717 });
718 }
719 }
720 }
721 }
722 }