(m2 *MPath)
| 698 | } |
| 699 | |
| 700 | func (m *MPath) CommonRoot(m2 *MPath) *MPath { |
| 701 | root := &MPath{} |
| 702 | |
| 703 | if origMPathSegment, targetMPathSegment := m.GetMPath1(), m2.GetMPath1(); origMPathSegment == targetMPathSegment { |
| 704 | root.SetMPath1(origMPathSegment) |
| 705 | } else { |
| 706 | common := std.CommonPrefixLen(origMPathSegment, targetMPathSegment) |
| 707 | root.SetMPath1(origMPathSegment[:common]) |
| 708 | } |
| 709 | |
| 710 | if origMPathSegment, targetMPathSegment := m.GetMPath2(), m2.GetMPath2(); origMPathSegment == targetMPathSegment { |
| 711 | root.SetMPath1(origMPathSegment) |
| 712 | } else { |
| 713 | common := std.CommonPrefixLen(origMPathSegment, targetMPathSegment) |
| 714 | root.SetMPath1(origMPathSegment[:common]) |
| 715 | } |
| 716 | |
| 717 | if origMPathSegment, targetMPathSegment := m.GetMPath3(), m2.GetMPath3(); origMPathSegment == targetMPathSegment { |
| 718 | root.SetMPath1(origMPathSegment) |
| 719 | } else { |
| 720 | common := std.CommonPrefixLen(origMPathSegment, targetMPathSegment) |
| 721 | root.SetMPath1(origMPathSegment[:common]) |
| 722 | } |
| 723 | |
| 724 | if origMPathSegment, targetMPathSegment := m.GetMPath4(), m2.GetMPath4(); origMPathSegment == targetMPathSegment { |
| 725 | root.SetMPath1(origMPathSegment) |
| 726 | } else { |
| 727 | common := std.CommonPrefixLen(origMPathSegment, targetMPathSegment) |
| 728 | root.SetMPath1(origMPathSegment[:common]) |
| 729 | } |
| 730 | |
| 731 | return root |
| 732 | } |
| 733 | |
| 734 | // MPathEquals greater than for where |
| 735 | type MPathEquals struct { |
no test coverage detected