diff options
author | David Robillard <d@drobilla.net> | 2018-11-11 14:26:50 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-11 14:26:50 +0100 |
commit | dec98f7382b052388460f217157bd60f23b613a9 (patch) | |
tree | e277b4f316685df1c96813a0c56d03721ad046c7 | |
parent | 35b439b93c968356915b856dd8f77df9dad11cda (diff) | |
download | serd-dec98f7382b052388460f217157bd60f23b613a9.tar.gz serd-dec98f7382b052388460f217157bd60f23b613a9.tar.bz2 serd-dec98f7382b052388460f217157bd60f23b613a9.zip |
Shrink serd_byte_source_advance() code slightly
-rw-r--r-- | src/serd_internal.h | 6 |
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 */ |