commit | b0810c51c3f075cc8a309bfb3c1714ac42b0f020 | [log] [tgz] |
---|---|---|
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Thu Apr 11 11:29:16 2019 -0300 |
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Thu Apr 11 11:29:16 2019 -0300 |
tree | 8d9e58246f442f1fbec8bb14ffebb77bd40c3564 | |
parent | a93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4 [diff] |
Small optimizations in 'string.gsub' Avoid creating extra strings when possible: - avoid creating new resulting string when subject was not modified (instead, return the subject itself); - avoid creating strings representing the captured substrings when handling replacements like '%1' (instead, add the substring directly to the buffer).