Use a plain String instead of CharArrayBuffer.
The code used to use CharArrayBuffer to store the numbers as they are being processed. However, AbstractCursor.copyToCharArrayBuffer() actually calls AbstractCursor.getString() and we actually instantiate a new String when comparing the phone numbers: we might as well call Cursor.getString() directly and avoid creating two new String objects each time we need to compare numbers. Empirically, this seems to reduce the run time of the addGroups() method. Bug: 5290401 Change-Id: I397a9e6a14657ce261f8b8c11e607b13083bdef1
Loading
Please register or sign in to comment