diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 22:44:36 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-05-27 21:10:21 +0200 |
commit | 3e28f23571213b3d92001e9e9aa6d6fe23073573 (patch) | |
tree | 96a547ebabb3a2b7133c932de12008382c6c576c /src/reader.h | |
parent | c4b5d8a5f6973952b510ebd321cbac8aa5fb5267 (diff) | |
download | serd-3e28f23571213b3d92001e9e9aa6d6fe23073573.tar.gz serd-3e28f23571213b3d92001e9e9aa6d6fe23073573.tar.bz2 serd-3e28f23571213b3d92001e9e9aa6d6fe23073573.zip |
Simplify stack management by popping in bulk at higher levels
Since all memory used by the reader is POD in the stack, there is no benefit to
forcing code to explicitly pop everything pushed to the stack, since any
function can record an offset and pop back down to it regardless of what its
callers pushed if it knows that it does not need those items.
Diffstat (limited to 'src/reader.h')
-rw-r--r-- | src/reader.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/reader.h b/src/reader.h index 92baac3f..8c201e60 100644 --- a/src/reader.h +++ b/src/reader.h @@ -87,8 +87,6 @@ size_t genid_size(SerdReader* reader); SerdNode* blank_id(SerdReader* reader); void set_blank_id(SerdReader* reader, SerdNode* node, size_t buf_size); -SerdNode* pop_node(SerdReader* reader, const SerdNode* node); - bool emit_statement(SerdReader* reader, ReadContext ctx, SerdNode* o, @@ -148,7 +146,7 @@ eat_string(SerdReader* reader, const char* str, unsigned n) static inline SerdStatus push_byte(SerdReader* reader, SerdNode* node, const uint8_t c) { - SERD_STACK_ASSERT_TOP(reader, ref); + SERD_STACK_ASSERT_TOP(reader, node); char* const s = (char*)serd_stack_push(&reader->stack, 1); if (!s) { return SERD_ERR_OVERFLOW; |