>>> get_intersected_length([1, 9], [2, 8]) 7 >>> get_intersected_length([2, 8], [1, 9]) 7 >>> get_intersected_length([1, 4], [1, 5]) 4 >>> get_intersected_length([2, 10], [4, 11]) 7
(a, b)
| 1 | def get_intersected_length(a, b): |
| 2 | """ |
| 3 | >>> get_intersected_length([1, 9], [2, 8]) |
| 4 | 7 |
| 5 | >>> get_intersected_length([2, 8], [1, 9]) |
| 6 | 7 |
| 7 | >>> get_intersected_length([1, 4], [1, 5]) |
| 8 | 4 |
| 9 | >>> get_intersected_length([2, 10], [4, 11]) |
| 10 | 7 |
| 11 | """ |
| 12 | start = a[0] if a[0] >= b[0] else b[0] |
| 13 | end = a[1] if a[1] <= b[1] else b[1] |
| 14 | if start > end: |
| 15 | return 0 |
| 16 | else: |
| 17 | return end - start + 1 |
| 18 | |
| 19 | |
| 20 | def get_changed_functions(func_names, func_ranges, additions, deletions, |
no outgoing calls
no test coverage detected