From d1867d49399c1a73f108c6bf8df8183984bbe03a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jun 2020 17:38:10 +0200 Subject: Cleanup: Remove unnecessary stores --- src/n3.c | 2 +- src/uri.c | 2 +- tests/serd_test.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/n3.c b/src/n3.c index 4b9ba7cf..bcaf7aba 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1147,7 +1147,7 @@ read_collection(SerdReader* reader, ReadContext ctx, Ref* dest) Ref rest = 0; ctx.subject = *dest; - while (!(end = peek_delim(reader, ')'))) { + while (!peek_delim(reader, ')')) { // _:node rdf:first object ctx.predicate = reader->rdf_first; bool ate_dot = false; diff --git a/src/uri.c b/src/uri.c index 4528f0f4..dd306bf5 100644 --- a/src/uri.c +++ b/src/uri.c @@ -413,7 +413,7 @@ write_rel_path(SerdSink sink, } // Write suffix - return len += write_path_tail(sink, stream, uri, last_shared_sep + 1); + return len + write_path_tail(sink, stream, uri, last_shared_sep + 1); } static uint8_t diff --git a/tests/serd_test.c b/tests/serd_test.c index 696866fc..9650dfc5 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -288,13 +288,12 @@ test_strlen(void) static void test_strerror(void) { - const uint8_t* msg = NULL; - assert(!strcmp((const char*)(msg = serd_strerror(SERD_SUCCESS)), "Success")); + assert(!strcmp((const char*)(serd_strerror(SERD_SUCCESS)), "Success")); for (int i = SERD_FAILURE; i <= SERD_ERR_INTERNAL; ++i) { - msg = serd_strerror((SerdStatus)i); + const uint8_t* const msg = serd_strerror((SerdStatus)i); assert(strcmp((const char*)msg, "Success")); } - msg = serd_strerror((SerdStatus)-1); + serd_strerror((SerdStatus)-1); } static void -- cgit v1.2.1