Skip to content

Commit c3965cf

Browse files
committed
Suppress "literal string will be frozen" warnings
1 parent a1cd625 commit c3965cf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/groonga/command/parser.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2011-2019 Kouhei Sutou <kou@clear-code.com>
1+
# Copyright (C) 2011-2024 Sutou Kouhei <kou@clear-code.com>
22
#
33
# This library is free software; you can redistribute it and/or
44
# modify it under the terms of the GNU Lesser General Public
@@ -345,7 +345,8 @@ def parse_command_line(command_line)
345345
def reset
346346
@command = nil
347347
@loading = false
348-
@buffer = "".force_encoding("ASCII-8BIT")
348+
@buffer = +""
349+
@buffer.force_encoding("ASCII-8BIT")
349350
@load_values_parser = nil
350351
end
351352

@@ -371,7 +372,8 @@ def initialize_load_values_parser
371372
if @loading
372373
@command.original_source << consumed if @need_original_source
373374
if @buffer.bytesize == consumed.bytesize
374-
@buffer = "".force_encoding("ASCII-8BIT")
375+
@buffer = +""
376+
@buffer.force_encoding("ASCII-8BIT")
375377
else
376378
@buffer = @buffer[consumed.bytesize..-1]
377379
end

lib/groonga/command/parser/command-line-splitter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
1+
# Copyright (C) 2015-2024 Sutou Kouhei <kou@clear-code.com>
22
#
33
# This library is free software; you can redistribute it and/or
44
# modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@ def split
3232
start_quote = nil
3333
until scanner.eos?
3434
if start_quote
35-
token = ""
35+
token = +""
3636
loop do
3737
chunk = scanner.scan_until(/#{Regexp.escape(start_quote)}/)
3838
if chunk.nil?

lib/groonga/command/parser/error.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# Copyright (C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
1+
# Copyright (C) 2011-2024 Sutou Kouhei <kou@clear-code.com>
42
#
53
# This library is free software; you can redistribute it and/or
64
# modify it under the terms of the GNU Lesser General Public
@@ -31,7 +29,7 @@ def initialize(reason, before, after)
3129

3230
private
3331
def compute_location(before, after)
34-
location = ""
32+
location = +""
3533
if before[-1] == ?\n
3634
location << before
3735
location << after

0 commit comments

Comments
 (0)