Is the use of the comma operator intentional, or a typo?
Commit 60471b8e introduced this code in the function
if (g_str_equal (cur_attr->name, "k")) key = cur_attr->children->content, ""; else if (g_str_equal (cur_attr->name, "v")) value = cur_attr->children->content, "";
Note the use of the comma operator. Is that code really as it was intended to be, or is there a typo in there?
I am asking because the comma operator evaluates the first argument (ie.,
cur_attr->children->content in this case) and discards it, then evaluates the second argument and returns its value. So unless the first argument has any visible side-effects, it doesn't seem to serve any purpose. It's not clear to me that
cur_attr->children->content has any side-effect in the above snippet. I also couldn't find anything in the original review for the commit.