Refactor CollectionVector::SortByMapOrder
The current implementation of the SortByMapOrder method is
making use of std::unique_ptr::release to clear the pointer
maintained in the vector during the sorting phase in order
to avoid potential double-free errors, but this is triggering
the bugprone-unused-return-value check in clang-tidy. This
refactor gets rid of the need to call release, making it
programmatically safe to move pointers while sorting, while
maintaining the same O(n) time complexity.
Bug: 213953102
Test: m tidy-art
Test: atest art_dexlayout_tests (especially DexLayoutTest.DexFileOutput)
Change-Id: I525299c347d89171f91e10323d5aa8702e22b8d5
1 file changed