Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0008d219 authored by Ben Clark's avatar Ben Clark
Browse files

Refactor to remove multiple in-loop Object[]->String[] castings

(This replaces Iaa0f3b25eaadb094a4c3fb4cecbd09e0322aae33)

This change removes the need to convert Object[]->String[] for each iteration
of each of available,tethered,errored states in updateStatus()
by converting these as soon as possible.

This fix (and the code before) is strange because each of available,tethered,
errored are defined as type ArrayList<String> but
intent.getStringArrayListExtra() returns type Object[] dispite its name.
Because other calls to updateState() use String[] it seems best to do the
conversion outside this method in the Object[] case and thus avoid the
per-iteration casting in the Object[] case and the downright wasteful
per-iteration String[]->Object[]->String[] casting in the String[] input cases.

I've also removed some unused imports and an unused variable.

Change-Id: I805ef19aa9ceff7e4fc491623cdcb413ce170798
parent 46c0a5b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment