pytorch
be71f663 - StringUtils: Avoid unnecessary allocation in ReplaceAll (#79915)

Commit
3 years ago
StringUtils: Avoid unnecessary allocation in ReplaceAll (#79915) When the replacement string is smaller than the search string, `ReplaceAll` can operate in-place on the original string and so avoid an extra allocation and some string copies. As suggested in https://github.com/pytorch/pytorch/pull/76976#discussion_r902036461 Pull Request resolved: https://github.com/pytorch/pytorch/pull/79915 Approved by: https://github.com/ezyang
Committer
Parents
Loading