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 Dec 24, 2024
1 parent a1cd625 commit c3965cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 5 additions & 3 deletions lib/groonga/command/parser.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2011-2019 Kouhei Sutou <[email protected]>
# Copyright (C) 2011-2024 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 @@ -345,7 +345,8 @@ def parse_command_line(command_line)
def reset
@command = nil
@loading = false
@buffer = "".force_encoding("ASCII-8BIT")
@buffer = +""
@buffer.force_encoding("ASCII-8BIT")
@load_values_parser = nil
end

Expand All @@ -371,7 +372,8 @@ def initialize_load_values_parser
if @loading
@command.original_source << consumed if @need_original_source
if @buffer.bytesize == consumed.bytesize
@buffer = "".force_encoding("ASCII-8BIT")
@buffer = +""
@buffer.force_encoding("ASCII-8BIT")
else
@buffer = @buffer[consumed.bytesize..-1]
end
Expand Down
4 changes: 2 additions & 2 deletions lib/groonga/command/parser/command-line-splitter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2015 Kouhei Sutou <[email protected]>
# Copyright (C) 2015-2024 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 @@ -32,7 +32,7 @@ def split
start_quote = nil
until scanner.eos?
if start_quote
token = ""
token = +""
loop do
chunk = scanner.scan_until(/#{Regexp.escape(start_quote)}/)
if chunk.nil?
Expand Down
6 changes: 2 additions & 4 deletions lib/groonga/command/parser/error.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2015 Kouhei Sutou <[email protected]>
# Copyright (C) 2011-2024 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 @@ -31,7 +29,7 @@ def initialize(reason, before, after)

private
def compute_location(before, after)
location = ""
location = +""
if before[-1] == ?\n
location << before
location << after
Expand Down

0 comments on commit c3965cf

Please sign in to comment.