Closed johnnychen94 closed 4 years ago
Nice, good improvement.
Can also split the content of the two branchs of the if
into their own functions.
One for handing non-existant file (handle_nonextistant
?), and one for handling disagreeing contents (handle_disagreement
?).
Mind to merge this? I'd like to open a new PR based on this so that it's easier to be reviewed.
I stand by my above comments re breaking it into more functions.
Ahh, yes, but I have"better" ideas than simply breaking it into parts, and that would change the code structure.
Or I could push commits into this branch if you like.
Ok lets merge this first.
The first commit flattens the nested code structure by removing the
try-catch
block. There're no function changes except usingisfile
to check if reference file exists. (Is there any special reason usingtry-catch
here?)