file: Improve performance of has_same_content by spawning cmp less frequently
* If the two sizes are different, files are different
* Else read the first SMALL_FILE_THRESHOLD bytes (64K)
* If the first bytes are different, files are different
* Else first bytes are identical, and if file size is
<= SMALL_FILE_THRESHOLD then files are identical
Only if all these checks fail, spawn external command `cmp -s` to do the
comparison.
Loading
Please register or sign in to comment