summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/struct.c b/struct.c
index 1bca90b633..2fadd47dfc 100644
--- a/struct.c
+++ b/struct.c
@@ -498,7 +498,6 @@ inspect_struct(VALUE s, VALUE dummy, int recur)
for (i=0; i<RSTRUCT_LEN(s); i++) {
VALUE slot;
ID id;
- const char *p;
if (i > 0) {
rb_str_cat2(str, ", ");
@@ -506,8 +505,7 @@ inspect_struct(VALUE s, VALUE dummy, int recur)
slot = RARRAY_PTR(members)[i];
id = SYM2ID(slot);
if (rb_is_local_id(id) || rb_is_const_id(id)) {
- p = rb_id2name(id);
- rb_str_cat2(str, p);
+ rb_str_append(str, rb_id2str(id));
}
else {
rb_str_append(str, rb_inspect(slot));