You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3463
-- Commit Summary --
* [tm_parser_format_function] Merge double `switch (lang)`
-- File Changes --
M src/tagmanager/tm_parser.c (36)
-- Patch Links --
https://github.com/geany/geany/pull/3463.patch https://github.com/geany/geany/pull/3463.diff
Hmmm, yes the original didn't make sense did it?
@b4n commented on this pull request.
/* retval before function */
g_string_prepend_c(str, ' '); g_string_prepend(str, retval); break; } + if (sep) + { + g_string_append(str, sep); + g_string_append(str, retval); + }
I'd rather have an if/else here if the value of `sep` is the criteria, like that I find the code weird as well. ```suggestion break; }
if (sep) { /* retval after function */ g_string_append(str, sep); g_string_append(str, retval); } else { /* retval before function */ g_string_prepend_c(str, ' '); g_string_prepend(str, retval); } ```
Hmmm, yes the original didn't make sense did it?
It did (see how the outer switch caught all the inner one's values), it was just a bit of a bizarre way of laying out the code.
Hmmm, yes the original didn't make sense did it?
it was just a bit of a bizarre way of laying out the code.
See edit adding the words I thought would be understood. :grin:
@ntrel pushed 1 commit.
9537ff1390b67c6e01914ac25e0d78d44c92e49f Update src/tagmanager/tm_parser.c
Merged #3463 into master.
github-comments@lists.geany.org