If there is any intersection between the two given sets of ranges, returns a range that falls within the intersection
| 5866 | // If there is any intersection between the two given sets of ranges, returns a range that |
| 5867 | // falls within the intersection |
| 5868 | Optional<KeyRangeRef> intersects(VectorRef<KeyRangeRef> lhs, VectorRef<KeyRangeRef> rhs) { |
| 5869 | if (lhs.size() && rhs.size()) { |
| 5870 | std::sort(lhs.begin(), lhs.end(), compareBegin); |
| 5871 | std::sort(rhs.begin(), rhs.end(), compareBegin); |
| 5872 | |
| 5873 | int l = 0, r = 0; |
| 5874 | while (l < lhs.size() && r < rhs.size()) { |
| 5875 | if (lhs[l].end <= rhs[r].begin) |
| 5876 | l++; |
| 5877 | else if (rhs[r].end <= lhs[l].begin) |
| 5878 | r++; |
| 5879 | else |
| 5880 | return lhs[l] & rhs[r]; |
| 5881 | } |
| 5882 | } |
| 5883 | |
| 5884 | return Optional<KeyRangeRef>(); |
| 5885 | } |
| 5886 | |
| 5887 | ACTOR void checkWrites(Reference<TransactionState> trState, |
| 5888 | Future<Void> committed, |
no test coverage detected