commit | 69aaa702a46c806f547055cf91ac7568d1616ff5 | [log] [tgz] |
---|---|---|
author | Kiran Ramachandra <kiranmr@google.com> | Tue May 21 20:18:28 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 19 20:22:19 2024 +0000 |
tree | 0d75d59c369e27971d243b7134d4e2a603b1f7b9 | |
parent | 8d8343e23b0e5e6538bb466bd897571bdd003a63 [diff] |
Optimized scheme sanitization performance by replacing regex operation with string replacement The `replaceAll` method utilizes regular expressions, which can incur a performance cost due to the parsing required. In this modified code, uses `replace` method instead. This change often leads to faster execution, as in many cases the replacement is unnecessary. When it is needed, replace operates in a more straightforward, linear fashion, avoiding the overhead associated with regular expressions. Bug: 261721900 Bug: 341043283 Test: atest FrameworksCoreTests:android.net.UriTest (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:003800764d6180cddb7202e4e46e7bd48b71d4b9) Merged-In: I02e6f225db36324d89b66db02c755822cfb29bc9 Change-Id: I02e6f225db36324d89b66db02c755822cfb29bc9