While, and, square brackets, looks messy
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
# Original code
```
page_a_in_a = 0
page_a_in_b = 0
common = 0
history_b = []
while page_a_in_b + common < len(history_b) and page_a_in_a + common < len(history_a) and history_a[page_a_in_a + common] == history_b[page_a_in_b + common]:
common += 1
```
# No config yapf
```
while page_a_in_b + common < len(
history_b
) and page_a_in_a + common < len(history_a) and history_a[
page_a_in_a + common] == history_b[page_a_in_b + common]:
common += 1
```
# Online yapf demo
```
page_a_in_a = 0
page_a_in_b = 0
common = 0
history_b = []
while page_a_in_b + common < len(history_b) and page_a_in_a + common < len(
history_a) and history_a[page_a_in_a + common] == history_b[page_a_in_b
+ common]:
common += 1
```
# Ideal in my opinion
```
while page_a_in_b + common < len(history_b) \
and page_a_in_a + common < len(history_a) \
and history_a[page_a_in_a + common] == history_b[page_a_in_b + common]:
common += 1
```
Contributor guide
Assessment
This issue has not been assessed yet.