aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-11 14:26:50 +0100
committerDavid Robillard <d@drobilla.net>2018-11-11 14:26:50 +0100
commitdec98f7382b052388460f217157bd60f23b613a9 (patch)
treee277b4f316685df1c96813a0c56d03721ad046c7
parent35b439b93c968356915b856dd8f77df9dad11cda (diff)
downloadserd-dec98f7382b052388460f217157bd60f23b613a9.tar.gz
serd-dec98f7382b052388460f217157bd60f23b613a9.tar.bz2
serd-dec98f7382b052388460f217157bd60f23b613a9.zip
Shrink serd_byte_source_advance() code slightly
-rw-r--r--src/serd_internal.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h
index 0bc1cf42..243c1327 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -151,13 +151,11 @@ serd_byte_source_advance(SerdByteSource* source)
: SERD_FAILURE;
}
}
- } else if (source->eof) {
- st = SERD_FAILURE; // Can't read past end of string
- } else {
+ } else if (!source->eof) {
++source->read_head; // Move to next character in string
}
- return st;
+ return source->eof ? SERD_FAILURE : st;
}
/* Stack */