mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
Avoid needless object allocation
This commit is contained in:
parent
822d7ae316
commit
2439948bcc
3 changed files with 7 additions and 2 deletions
|
@ -437,7 +437,7 @@ module TestStruct
|
|||
assert_equal({a: 1, b: 2}, o.deconstruct_keys(nil))
|
||||
assert_equal({a: 1, b: 2}, o.deconstruct_keys([:b, :a]))
|
||||
assert_equal({a: 1}, o.deconstruct_keys([:a]))
|
||||
assert_equal({}, o.deconstruct_keys([:a, :c]))
|
||||
assert_not_send([o.deconstruct_keys([:a, :c]), :key?, :c])
|
||||
assert_raise(TypeError) {
|
||||
o.deconstruct_keys(0)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue