Skip to content

Commit 6fb02e0

Browse files
committed
Avoid use of unless.
1 parent b031cb3 commit 6fb02e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/ruby/core/string.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,11 +1591,11 @@ def +@
15911591

15921592
def -@
15931593
str = frozen? ? self : dup.freeze
1594-
unless str.tainted? || !(str.instance_variables).empty?
1594+
if str.tainted? || !(str.instance_variables).empty?
1595+
str
1596+
else
15951597
Truffle::Ropes.flatten_rope(str)
15961598
Truffle.invoke_primitive(:string_intern, str)
1597-
else
1598-
str
15991599
end
16001600
end
16011601

0 commit comments

Comments
 (0)