Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unused variables #2386

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bin/natalie
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ class Runner
end

def run_temp_and_wait(path)
build_dir = File.expand_path('../build', __dir__)
var_name = RbConfig::CONFIG['LIBPATHENV']
env = { var_name => Natalie::Compiler::CppBackend::LIB_PATHS.join(':') }
pid = spawn(env, path, *ARGV)
Expand Down
2 changes: 1 addition & 1 deletion lib/natalie/compiler/backends/cpp_backend/transform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def add_file(name)

def value_has_side_effects?(value)
return false if value =~ /^Value\((False|Nil|True)Object::the\(\)\)$/
return false if value =~ /^Value\([\w_]*symbols\[\d+\]\/\*\:[^\*]+\*\/\)$/
return false if value =~ /^Value\(\w*symbols\[\d+\]\/\*\:[^\*]+\*\/\)$/
true
end

Expand Down
1 change: 0 additions & 1 deletion lib/natalie/compiler/bytecode/ro_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def self.load(str)
def add(value)
return @add_lookup[value] if @add_lookup.key?(value)

size = value.bytesize
position = @buffer.size
@buffer << [value.bytesize].pack('w')
@buffer << value.b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def execute(vm)
end

def serialize(_)
name_string = @name.to_s
[
instruction_number,
@exclude_end ? 1 : 0,
Expand Down
3 changes: 2 additions & 1 deletion lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def initialize
yield self if block_given?
end

attr_accessor :banner, :program_name, :version
attr_accessor :banner, :program_name
attr_writer :version

def on(*args, options: nil, &block)
short_name, short_value = args.grep(/^\-[^\-]/).first&.split(/[ =]/, 2)
Expand Down
Loading