aboutsummaryrefslogtreecommitdiffstats
path: root/src/read_turtle.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-04-10 18:38:56 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commitb839af39ad87fbf0fe30fd500b596a5593c13a69 (patch)
tree2cc2bd60bd1e28cd966f694a3329cdbd8c80b023 /src/read_turtle.c
parentc8594c69b612005c7507ad00f7274ca7791197d7 (diff)
downloadserd-b839af39ad87fbf0fe30fd500b596a5593c13a69.tar.gz
serd-b839af39ad87fbf0fe30fd500b596a5593c13a69.tar.bz2
serd-b839af39ad87fbf0fe30fd500b596a5593c13a69.zip
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.
Diffstat (limited to 'src/read_turtle.c')
-rw-r--r--src/read_turtle.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/read_turtle.c b/src/read_turtle.c
index d8a5de3e..03d1950f 100644
--- a/src/read_turtle.c
+++ b/src/read_turtle.c
@@ -581,9 +581,8 @@ read_verb(SerdReader* reader, SerdNode** const dest)
if (node->length == 1 && serd_node_string(node)[0] == 'a' && next != ':' &&
!is_PN_CHARS_BASE(next)) {
serd_stack_pop_to(&reader->stack, orig_stack_size);
- return ((*dest = push_node(reader, SERD_URI, NS_RDF "type", 47))
- ? SERD_SUCCESS
- : SERD_BAD_STACK);
+ *dest = reader->rdf_type;
+ return SERD_SUCCESS;
}
if ((st = read_PrefixedName(