It seems to me that we need to delete the “else” since in the original formula, we have a minimum between candidate count and reference count. These is no mention that we need to implement 0 in case where candidate_count < ref_count
Yes it does look like the code runs fine without else statement, but probably they added that condition for showing there is no precision score or match between candidate and reference sentences.
As I mentioned above, this should not be an issue, since the else statement deals with a non-existent ngram and assigns 0 when the ngram is not found - a desired behavior since the reference count is 0 and the min should be 0.