avm2: Short circuit the regexp replacement logic if it's a simple (no pattern) string
This commit is contained in:
parent
ef42bba20c
commit
0023062c82
|
@ -159,6 +159,10 @@ impl<'gc> RegExp<'gc> {
|
|||
text: &AvmString<'gc>,
|
||||
m: ®ress::Match,
|
||||
) -> WString {
|
||||
if !replacement.contains(b'$') {
|
||||
// Nothing to do if there's no $ replacement symbols
|
||||
return replacement.as_wstr().to_owned();
|
||||
}
|
||||
let mut ret = WString::new();
|
||||
let s = replacement.as_wstr();
|
||||
let mut chars = s.chars().peekable();
|
||||
|
|
Loading…
Reference in New Issue