mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: Remove dispose_string
I think that recycling the delimiter string objects doesn't pay its complexity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
380c84ea26
commit
ec01271cae
3 changed files with 0 additions and 21 deletions
11
node.c
11
node.c
|
@ -1136,14 +1136,3 @@ rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj)
|
|||
{
|
||||
rb_ary_push(ast->mark_ary, obj);
|
||||
}
|
||||
|
||||
void
|
||||
rb_ast_delete_mark_object(rb_ast_t *ast, VALUE obj)
|
||||
{
|
||||
long i;
|
||||
for (i = 0; i < RARRAY_LEN(ast->mark_ary); i++) {
|
||||
if (obj == RARRAY_AREF(ast->mark_ary, i)) {
|
||||
RARRAY_ASET(ast->mark_ary, i, Qnil);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
1
node.h
1
node.h
|
@ -479,7 +479,6 @@ void rb_ast_mark(rb_ast_t*);
|
|||
void rb_ast_dispose(rb_ast_t*);
|
||||
void rb_ast_free(rb_ast_t*);
|
||||
void rb_ast_add_mark_object(rb_ast_t*, VALUE);
|
||||
void rb_ast_delete_mark_object(rb_ast_t*, VALUE);
|
||||
NODE *rb_ast_newnode(rb_ast_t*);
|
||||
void rb_ast_delete_node(rb_ast_t*, NODE *n);
|
||||
|
||||
|
|
9
parse.y
9
parse.y
|
@ -6123,14 +6123,6 @@ parser_regx_options(struct parser_params *parser)
|
|||
return options | RE_OPTION_ENCODING(kcode);
|
||||
}
|
||||
|
||||
static void
|
||||
dispose_string(struct parser_params *parser, VALUE str)
|
||||
{
|
||||
rb_ast_delete_mark_object(parser->ast, str);
|
||||
rb_str_free(str);
|
||||
rb_gc_force_recycle(str);
|
||||
}
|
||||
|
||||
static int
|
||||
parser_tokadd_mbchar(struct parser_params *parser, int c)
|
||||
{
|
||||
|
@ -6907,7 +6899,6 @@ parser_here_document(struct parser_params *parser, rb_strterm_heredoc_t *here)
|
|||
}
|
||||
if (nextc() == -1) {
|
||||
if (str) {
|
||||
dispose_string(parser, str);
|
||||
str = 0;
|
||||
}
|
||||
goto error;
|
||||
|
|
Loading…
Reference in a new issue