summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-14 15:06:38 -0400
committerDavid Robillard <d@drobilla.net>2016-07-14 15:47:47 -0400
commit84ec2ee47279f87b4ed9ee44c9153f52a97732da (patch)
tree33ff024e51103ce035e51206ba1d8ba609769a30 /src/util.c
parent9da2f26c8a8fcd533c61e9cfafb92a653131f285 (diff)
downloadlilv-84ec2ee47279f87b4ed9ee44c9153f52a97732da.tar.gz
lilv-84ec2ee47279f87b4ed9ee44c9153f52a97732da.tar.bz2
lilv-84ec2ee47279f87b4ed9ee44c9153f52a97732da.zip
Clean up and remove dead code
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/util.c b/src/util.c
index 5b38259..6cc7cc5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -602,19 +602,16 @@ lilv_file_equals(const char* a_path, const char* b_path)
FILE* b_file = NULL;
char* const a_real = lilv_realpath(a_path);
char* const b_real = lilv_realpath(b_path);
- if (!a_real || !b_real) {
- match = false; // Missing file matches nothing
- } else if (!strcmp(a_real, b_real)) {
+ if (!strcmp(a_real, b_real)) {
match = true; // Real paths match
} else if (lilv_file_size(a_path) != lilv_file_size(b_path)) {
match = false; // Sizes differ
- } else if (!(a_file = fopen(a_real, "rb"))) {
- match = false; // Missing file matches nothing
- } else if (!(b_file = fopen(b_real, "rb"))) {
+ } else if (!(a_file = fopen(a_real, "rb")) ||
+ !(b_file = fopen(b_real, "rb"))) {
match = false; // Missing file matches nothing
} else {
- match = true;
// TODO: Improve performance by reading chunks
+ match = true;
while (!feof(a_file) && !feof(b_file)) {
if (fgetc(a_file) != fgetc(b_file)) {
match = false;