Le 07/10/2011 03:19, Steven D'Aprano a écrit : > Given that strings are immutable, would it not be an obvious > optimization for replace to return the source string unchanged if the > old and new substrings are equal, and avoid making a potentially > expensive copy? I just implemented this optimization in 9c1b76936b79, but only if old and new substrings are the same object (old is new). *Compare* substrings (content) would slow down .replace() in most cases. Victor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4