Commit 5392e4a8 authored by Neil Fuller's avatar Neil Fuller
Browse files

Improve performance of Enum.valueOf(Class, String)

Enum.valueOf() would loop through all enum values, returning
the final matching one. The common case is that there is one
match: we can loop backwards and return on the first match.

Bug: 32104997
Test: CtsLibcoreTestCases
Change-Id: I11051d28525dd49527e056ecce7f4cdd928cf24d
parent 4193cab1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment