In sass-embedded, it is protobuf returning frozen string as result. While we could unfreeze it after we get the result in upstream libraries e.g. sass-embedd or tilt, it is intentionally left frozen for best performance. Therefore, this PR updates the code to conditionally use .gsub vs .gsub!. I did a benchmark locally and it is consistently at least around 5% faster than (+text).gsub! on my machine.
Fixes #195.
In sass-embedded, it is protobuf returning frozen string as result. While we could unfreeze it after we get the result in upstream libraries e.g. sass-embedd or tilt, it is intentionally left frozen for best performance. Therefore, this PR updates the code to conditionally use
.gsub
vs.gsub!
. I did a benchmark locally and it is consistently at least around 5% faster than(+text).gsub!
on my machine.