Project

General

Profile

Feature #14624

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

This causes a bunch of unnecessary string allocations in the following scenario: `"#{'rails' "#{'rails' unless boolean_condition} is great"`. great". Each time this line is called when `boolean_condition` boolean_condition is true, it evaluates to `nil` nil and when `nil` nil is interpolated into a string it allocates an empty string. Ideally, the behavior of `nil.to_s` nil.to_s would reference a frozen empty string that wouldn't need to be reallocated each time.

Back