Skip to content

Commit

Permalink
Suppress literal string will be frozen warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 8, 2025
1 parent 568ffac commit 7d32fe1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
6 changes: 2 additions & 4 deletions lib/groonga/context.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 Kouhei Sutou <[email protected]>
# Copyright (C) 2010-2025 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -232,7 +230,7 @@ def execute_command(name, parameters={})
# @yieldparam response [String] A response for a command.
# @return [void]
def restore(dumped_commands)
buffer = ""
buffer = +""
continued = false
dumped_commands.each_line do |line|
line = line.chomp
Expand Down
8 changes: 3 additions & 5 deletions lib/groonga/dumper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2016 Kouhei Sutou <[email protected]>
# Copyright (C) 2011-2025 Sutou Kouhei <[email protected]>
# Copyright (C) 2014 Masafumi Yokoyama <[email protected]>
#
# This library is free software; you can redistribute it and/or
Expand All @@ -26,7 +24,7 @@ def default_output
end

def utf8_string
""
+""
end
end

Expand Down Expand Up @@ -759,7 +757,7 @@ def resolve_value(record, column, value)
""
else
return value unless value.respond_to?(:valid_encoding?)
sanitized_value = ""
sanitized_value = +""
value = fix_encoding(value)
value.each_char do |char|
if char.valid_encoding?
Expand Down
6 changes: 2 additions & 4 deletions lib/groonga/patricia-trie.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2010 Kouhei Sutou <[email protected]>
# Copyright (C) 2009-2025 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -55,7 +53,7 @@ def tag_keys(text, options={})
options ||= {}
other_text_handler = options[:other_text_handler]
position = 0
result = ''
result = +""
if text.respond_to?(:encoding)
encoding = text.encoding
bytes = text.dup.force_encoding("ascii-8bit")
Expand Down
6 changes: 3 additions & 3 deletions test/test-database-inspector.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Kouhei Sutou <[email protected]>
# Copyright (C) 2013-2025 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -131,7 +131,7 @@ def inspect_columns(columns)
None
INSPECTED
else
inspected = " Columns:\n"
inspected = +" Columns:\n"
columns.each do |column|
inspected << inspect_column(column)
end
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_has_tables

private
def inspected(n_tables)
inspected_tables = " Tables:\n"
inspected_tables = +" Tables:\n"
if @database.tables.empty?
inspected_tables << " None\n"
else
Expand Down
10 changes: 5 additions & 5 deletions test/test-schema-dumper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009-2016 Kouhei Sutou <[email protected]>
# Copyright (C) 2009-2025 Sutou Kouhei <[email protected]>
# Copyright (C) 2014-2016 Masafumi Yokoyama <[email protected]>
#
# This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -427,7 +427,7 @@ def test_double_array_trie
class ColumnCompressionTest < self
def test_zlib
define_column_compression_zlib_schema
flags = "COLUMN_SCALAR"
flags = +"COLUMN_SCALAR"
flags << "|COMPRESS_ZLIB" if context.support_zlib?
assert_equal(<<-SCHEMA, dump)
table_create Posts TABLE_NO_KEY
Expand All @@ -437,7 +437,7 @@ def test_zlib

def test_lz4
define_column_compression_lz4_schema
flags = "COLUMN_SCALAR"
flags = +"COLUMN_SCALAR"
flags << "|COMPRESS_LZ4" if context.support_lz4?
assert_equal(<<-SCHEMA, dump)
table_create Posts TABLE_NO_KEY
Expand All @@ -447,7 +447,7 @@ def test_lz4

def test_zstd
define_column_compression_zstd_schema
flags = "COLUMN_SCALAR"
flags = +"COLUMN_SCALAR"
flags << "|COMPRESS_ZSTD" if context.support_zstd?
assert_equal(<<-SCHEMA, dump)
table_create Posts TABLE_NO_KEY
Expand All @@ -457,7 +457,7 @@ def test_zstd

def test_with_weight_vector
define_column_compression_with_weight_vector_schema
flags = "COLUMN_VECTOR|WITH_WEIGHT"
flags = +"COLUMN_VECTOR|WITH_WEIGHT"
flags << "|COMPRESS_ZLIB" if context.support_zlib?
assert_equal(<<-SCHEMA, dump)
table_create Posts TABLE_NO_KEY
Expand Down

0 comments on commit 7d32fe1

Please sign in to comment.