Fix redundancy of value check

I found the variable diffs is checked twice.
This is redundant, so I fixed it.

I found that by my static analysis tool [FlawDetector](https://github.com/ginriki/flaw_detector).