Optimize EOF checking in hed_file_set_byte
commit188d0f3ceef154573b6e733c11541d16073411c4
authorPetr Tesarik <petr@tesarici.cz>
Tue, 16 Oct 2012 23:39:39 +0000 (17 01:39 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Tue, 16 Oct 2012 23:39:39 +0000 (17 01:39 +0200)
treec506f96a53d7346d5459d45903a60e5f3c80c3e7
parentd29bd879b62418331eb1001b226cc74a4c206f2a
Optimize EOF checking in hed_file_set_byte

Instead of comparing the position, check the EOF flag of the following
block. Note that I can't use the current block, because that is already
devirtualized when I check, and I cannot check earlier, because
prepare_modify() may fail and I would have to roll back.

Note that next_block() must always return a valid block pointer here.
libhed/file.c