From b839af39ad87fbf0fe30fd500b596a5593c13a69 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 10 Apr 2022 18:38:56 -0400 Subject: Reuse the same rdf:type node for all "a" abbreviations This reduces the stack space requirements for every type statement, at the cost of adding a bit of constant bloat for the node in documents that do not contain it. --- src/reader.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/reader.c') diff --git a/src/reader.c b/src/reader.c index 73509c6f..b7a64ce4 100644 --- a/src/reader.c +++ b/src/reader.c @@ -271,11 +271,13 @@ serd_reader_new(SerdWorld* const world, me->rdf_first = push_node(me, SERD_URI, NS_RDF "first", 48); me->rdf_rest = push_node(me, SERD_URI, NS_RDF "rest", 47); me->rdf_nil = push_node(me, SERD_URI, NS_RDF "nil", 46); + me->rdf_type = push_node(me, SERD_URI, NS_RDF "type", 47); // The initial stack size check should cover this assert(me->rdf_first); assert(me->rdf_rest); assert(me->rdf_nil); + assert(me->rdf_type); if (!(flags & SERD_READ_GLOBAL)) { me->bprefix[0] = 'f'; -- cgit v1.2.1