From e8335806afc45e31157937b880ff39b75c14a2cd Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 4 Oct 2013 12:04:39 +0000 Subject: GuString is now an ordinary C string - it makes live easier. In addition PgfSymbolKS, PgfExprFun and PgfLiteralStr now keep their strings as embedded flexible arrays. The latest change gives us the same compactness as the old representation but it is a lot easier to use. --- src/runtime/c/pgf/graphviz.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/runtime/c/pgf/graphviz.c') diff --git a/src/runtime/c/pgf/graphviz.c b/src/runtime/c/pgf/graphviz.c index e17d658b4..5bf270003 100644 --- a/src/runtime/c/pgf/graphviz.c +++ b/src/runtime/c/pgf/graphviz.c @@ -112,7 +112,6 @@ typedef struct { size_t level; GuBuf* internals; GuBuf* leaves; - GuString wildcard; } PgfBracketLznState; static void @@ -167,7 +166,7 @@ pgf_bracket_lzn_begin_phrase(PgfLinFuncs** funcs, PgfCId cat, int fid, int linde { PgfBracketLznState* state = gu_container(funcs, PgfBracketLznState, funcs); - if (gu_string_eq(cat, state->wildcard)) + if (strcmp(cat, "_") == 0) return; state->level++; @@ -203,7 +202,7 @@ pgf_bracket_lzn_end_phrase(PgfLinFuncs** funcs, PgfCId cat, int fid, int lindex, { PgfBracketLznState* state = gu_container(funcs, PgfBracketLznState, funcs); - if (gu_string_eq(cat, state->wildcard)) + if (strcmp(cat, "_") == 0) return; state->level--; @@ -281,7 +280,6 @@ pgf_graphviz_parse_tree(PgfConcr* concr, PgfExpr expr, GuOut* out, GuExn* err) state.level = -1; state.internals = gu_new_buf(GuBuf*, tmp_pool); state.leaves = gu_new_buf(PgfParseNode*, tmp_pool); - state.wildcard = gu_str_string("_", tmp_pool); pgf_lzr_linearize(concr, ctree, 0, &state.funcs); size_t len = gu_buf_length(state.internals); -- cgit v1.2.3