Project

General

Profile

Actions

Bug #12203

closed

dumper.c static int yaml_emitter_dump_scalar two variables have the same value

Added by fanantoxa (Anton Sivakov) almost 9 years ago. Updated over 7 years ago.

Status:
Third Party's Issue
Target version:
-
[ruby-core:74474]

Description

static int
yaml_emitter_dump_scalar(
.....
int plain_implicit = (strcmp((char *)node->tag,
               YAML_DEFAULT_SCALAR_TAG) == 0);
int quoted_implicit = (strcmp((char *)node->tag,
                YAML_DEFAULT_SCALAR_TAG) == 0);

variables 'plain_implicit' and 'quoted_implicit' have the same values. It possible wrong expression or this code can be optimized.

Updated by shyouhei (Shyouhei Urabe) almost 9 years ago

  • Status changed from Open to Assigned
  • Assignee set to tenderlovemaking (Aaron Patterson)

They are passed to a macro. I guess the author intentionally separated these two because merging them makes the code less intuitive. It seems OK to be optimized.

Updated by fanantoxa (Anton Sivakov) over 7 years ago

shyouhei (Shyouhei Urabe) wrote:

They are passed to a macro. I guess the author intentionally separated these two because merging them makes the code less intuitive. It seems OK to be optimized.

Maybe reassign to someone else? Or at lease chen that this still here?

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Assigned to Third Party's Issue

Please report it to the upstream, https://github.com/ruby/psych.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0