From 3e28f23571213b3d92001e9e9aa6d6fe23073573 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 May 2018 22:44:36 +0200 Subject: 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. --- src/reader.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/reader.h') 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; -- cgit v1.2.1