skip timestamp checking, remove duplicate code

1) No need compare all timestamps when all the values are within range
2) remove redundant code.
Merge pull request #834 from metamx/optimize-timestampchecking

skip timestamp checking if not required, remove duplicate code