From 5e95d04014e07013fba6f04d32e7808c6ea9db1c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Aug 2020 20:02:09 +0200 Subject: Remove unnecessary parameter from read_LANGTAG() --- src/n3.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/n3.c b/src/n3.c index b396b326..844204fb 100644 --- a/src/n3.c +++ b/src/n3.c @@ -641,26 +641,27 @@ read_PN_PREFIX(SerdReader* reader, SerdNode* dest) } static SerdStatus -read_LANGTAG(SerdReader* reader, SerdNode** dest) +read_LANGTAG(SerdReader* reader) { int c = peek_byte(reader); if (!is_alpha(c)) { return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c); } - if (!(*dest = push_node(reader, SERD_LITERAL, "", 0))) { + SerdNode* node = push_node(reader, SERD_LITERAL, "", 0); + if (!node) { return SERD_ERR_OVERFLOW; } SerdStatus st = SERD_SUCCESS; - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); while ((c = peek_byte(reader)) && is_alpha(c)) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } while (peek_byte(reader) == '-') { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, '-'))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, '-'))); while ((c = peek_byte(reader)) && (is_alpha(c) || is_digit(c))) { - TRY(st, push_byte(reader, *dest, eat_byte_safe(reader, c))); + TRY(st, push_byte(reader, node, eat_byte_safe(reader, c))); } } return SERD_SUCCESS; @@ -900,12 +901,11 @@ read_literal(SerdReader* reader, SerdNode** dest, bool* ate_dot) } SerdNode* datatype = NULL; - SerdNode* lang = NULL; switch (peek_byte(reader)) { case '@': eat_byte_safe(reader, '@'); (*dest)->flags |= SERD_HAS_LANGUAGE; - if ((st = read_LANGTAG(reader, &lang))) { + if ((st = read_LANGTAG(reader))) { return r_err(reader, st, "bad literal\n"); } break; -- cgit v1.2.1