aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-03-13 11:47:53 -0400
committerDavid Robillard <d@drobilla.net>2025-03-16 20:26:27 -0400
commit653476c24f9ab53e846426015f05a94b69d70e30 (patch)
treed457f1f4ce0f51376d8d6ff1fb1a614d9480b922
parente0e3cf8411e2de999a2184570ff9bfbaf3619d1d (diff)
downloadserd-653476c24f9ab53e846426015f05a94b69d70e30.tar.gz
serd-653476c24f9ab53e846426015f05a94b69d70e30.tar.bz2
serd-653476c24f9ab53e846426015f05a94b69d70e30.zip
Remove unused field and shrink WriteContext
-rw-r--r--src/writer.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/writer.c b/src/writer.c
index 61d3fe8d..6a5acaf0 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -37,11 +37,10 @@ typedef enum {
typedef struct {
ContextType type;
+ bool comma_indented;
SerdNode graph;
SerdNode subject;
SerdNode predicate;
- bool predicates;
- bool comma_indented;
} WriteContext;
typedef enum {
@@ -198,7 +197,7 @@ push_context(SerdWriter* const writer,
*(WriteContext*)top = writer->context;
// Update the current context
- const WriteContext current = {type, graph, subject, predicate, 0U, 0U};
+ const WriteContext current = {type, false, graph, subject, predicate};
writer->context = current;
}
@@ -572,7 +571,6 @@ write_sep(SerdWriter* const writer, const Sep sep)
// Reset context and write a blank line after ends of subjects
if (sep == SEP_END_S) {
writer->indent = writer->context.graph.type ? 1 : 0;
- writer->context.predicates = false;
writer->context.comma_indented = false;
TRY(st, esink("\n", 1, writer));
}
@@ -605,7 +603,6 @@ reset_context(SerdWriter* const writer, const unsigned flags)
writer->context.type = CTX_NAMED;
writer->context.subject.type = SERD_NOTHING;
writer->context.predicate.type = SERD_NOTHING;
- writer->context.predicates = false;
writer->context.comma_indented = false;
return SERD_SUCCESS;
}
@@ -857,7 +854,6 @@ write_pred(SerdWriter* const writer,
TRY(st, write_sep(writer, SEP_P_O));
copy_node(&writer->context.predicate, pred);
- writer->context.predicates = true;
writer->context.comma_indented = false;
return st;
}