User tests: Successful: 0 Unsuccessful: 0
Merged two if blocks with the same condition
Go to libraries/src/Document/HtmlDocument.php, see lines 707 and 712, if blocks on these lines have the same conditions and can be merged in order to reduce code.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-14 17:07:05 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
?
|
Sorry, I didn't notice that. I have to be more careful next time.
@eopws Sorry but this pull request is wrong. You are right, the "if" conditions are identical. But inside the first "if" block the "$template" variable is modified, and this is checked again in the "2nd" if condition. And so this sequence of if conditions has to be like it is. In general it is not enough to read just 1 or 2 lines of code, one should also read what is before and after these 2 lines of code and is relevant.