Skip to content

Commit

Permalink
Add fast path for string concatenation (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
RageKnify authored Sep 27, 2020
1 parent 0348ba9 commit 3ce547d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions boa/src/value/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ impl Value {
(Self::Integer(x), Self::Rational(y)) => Self::rational(f64::from(*x) + y),
(Self::Rational(x), Self::Integer(y)) => Self::rational(x + f64::from(*y)),

(Self::String(ref x), Self::String(ref y)) => Self::string(format!("{}{}", x, y)),
(Self::String(ref x), ref y) => Self::string(format!("{}{}", x, y.to_string(ctx)?)),
(ref x, Self::String(ref y)) => Self::string(format!("{}{}", x.to_string(ctx)?, y)),
(Self::BigInt(ref n1), Self::BigInt(ref n2)) => {
Expand Down

0 comments on commit 3ce547d

Please sign in to comment.