Skip to content

Commit

Permalink
Revert "[pmc] Avoid StringBuilder copies on set_pmc, ..."
Browse files Browse the repository at this point in the history
test: This reverts commit 9cf2c34.
  • Loading branch information
Reini Urban committed Jan 23, 2015
1 parent e3980fd commit 825c61c
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/pmc/stringbuilder.pmc
Expand Up @@ -269,25 +269,11 @@ Append string. Synonym for push_string
}

VTABLE void i_concatenate(PMC *p) :manual_wb {
if (p->vtable->base_type == enum_class_StringBuilder) {
STRING *buffer;
GET_ATTR_buffer(INTERP, p, buffer);
STATICSELF.push_string(buffer);
}
else {
STATICSELF.push_string(VTABLE_get_string(INTERP, p));
}
STATICSELF.push_string(VTABLE_get_string(INTERP, p));
}

VTABLE void push_pmc(PMC *p) :manual_wb {
if (p->vtable->base_type == enum_class_StringBuilder) {
STRING *buffer;
GET_ATTR_buffer(INTERP, p, buffer);
STATICSELF.push_string(buffer);
}
else {
STATICSELF.push_string(VTABLE_get_string(INTERP, p));
}
STATICSELF.push_string(VTABLE_get_string(INTERP, p));
}

/*
Expand Down Expand Up @@ -326,14 +312,7 @@ Set content of buffer to passed string or PMC
}

VTABLE void set_pmc(PMC *s) :manual_wb {
if (s->vtable->base_type == enum_class_StringBuilder) {
STRING *buffer;
GET_ATTR_buffer(INTERP, s, buffer);
STATICSELF.push_string(buffer);
}
else {
STATICSELF.set_string_native(VTABLE_get_string(INTERP, s));
}
STATICSELF.set_string_native(VTABLE_get_string(INTERP, s));
}


Expand Down

0 comments on commit 825c61c

Please sign in to comment.