Do replace operations with a single pass over the string
Conor MacNeill
Branch: issue/ACDEV-3592-canonicalizeSinglePass
Branch: master
Merged
Merged pull request
Merged in issue/ACDEV-3592-canonicalizeSinglePass (pull request #78)
Merged in issue/ACDEV-3592-canonicalizeSinglePass (pull request #78)
This replaces the three String.replace calls with a single iteration over the String to provide the particular character sequences. It avoids the use of regex compilations, and the traversals in replace()
We could combine this with the logic of URLEncoder to avoid that traversal but that would be a fair copy/paste duplication.
This change gives a reasonable performance improvement in my testing in Connect