The previous implementation only considered the case when more than one nearest time exists, so we introduced the prefer_early flag to decide which one to be selected.But the comparsion mistakenly omitted the edge case when the difference is 0.