diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/read_turtle.c | 5 | ||||
-rw-r--r-- | src/reader.c | 2 | ||||
-rw-r--r-- | src/reader.h | 1 |
3 files changed, 5 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( 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'; diff --git a/src/reader.h b/src/reader.h index 0bb3454b..9ec2e4ac 100644 --- a/src/reader.h +++ b/src/reader.h @@ -40,6 +40,7 @@ struct SerdReaderImpl { SerdNode* rdf_first; SerdNode* rdf_rest; SerdNode* rdf_nil; + SerdNode* rdf_type; SerdByteSource* source; SerdEnv* env; SerdStack stack; |