Skip to content

Commit 62c24b6

Browse files
committed
omit unnecessary call to rb_obj_freeze
1 parent dd70e03 commit 62c24b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/sqlite3/statement.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,15 @@ column_count(VALUE self)
366366

367367
#if HAVE_RB_ENC_INTERNED_STR_CSTR
368368
static VALUE
369-
interned_utf8_cstr(const char * str)
369+
interned_utf8_cstr(const char *str)
370370
{
371371
return rb_enc_interned_str_cstr(str, rb_utf8_encoding());
372372
}
373373
#else
374374
static VALUE
375-
interned_utf8_cstr(const char * str)
375+
interned_utf8_cstr(const char *str)
376376
{
377377
VALUE rb_str = rb_utf8_str_new_cstr(str);
378-
rb_obj_freeze(rb_str);
379378
return rb_funcall(rb_str, rb_intern("-@"), 0);
380379
}
381380
#endif

test/test_statement.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_column_names_are_deduped
5858
stmt = @db.prepare "SELECT float, int, text, string, nil FROM things"
5959
# Make sure this new statement returns the same interned strings
6060
stmt.columns.each_with_index do |str, i|
61+
assert_predicate columns[i], :frozen?
6162
assert_same columns[i], str
6263
end
6364
ensure

0 commit comments

Comments
 (0)