commit | 8726e1cf9b7dc4245751160e0c328ae45cd79a83 | [log] [tgz] |
---|---|---|
author | Tairu Wang <tairuw@google.com> | Tue Feb 20 00:12:20 2024 +0000 |
committer | Po-Chun Lee <pochunlee@google.com> | Tue Feb 20 19:25:34 2024 +0000 |
tree | 7f62760010e49b72a21810e6063cf9ea29a11918 | |
parent | 2bb7b2a4be3d5ab39fa8b162a28442da37c0691f [diff] |
Reuse Pattern instance to improve performance To improve the performance, explicitly compile the regular expression into a Pattern instance (which is immutable) as part of class initialization, cache it, and reuse the same instance for every invocation. Bug: 325342963 Test: atest IwlanTests (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a3dd84ad72786d8767d6b988f46a468404e117cd) Merged-In: Icaed3cfbfad3b47ea3230ce3c638b32d33914a90 Change-Id: Icaed3cfbfad3b47ea3230ce3c638b32d33914a90