openbmap / radiocells-scanner-android

WLAN and cell tower scanner for Radiocells.org
https://www.radiocells.org
Other
55 stars 26 forks source link

Use index-safe List in place of String[] #159

Closed agilob closed 8 years ago

agilob commented 8 years ago

Minor cleanup of single method.

+        // Create default / none entry
+        entries.add(getResources().getString(R.string.prefs_map_none));
+        values.add(Preferences.VAL_MAP_NONE);
+
+        entries.add(getResources().getString(R.string.prefs_map_online));
+        values.add(Preferences.VAL_MAP_ONLINE);

were added to the list anyway so I moved them above the loop to avoid duplicated code.

entries[i + 2] = this just looked wired and it's a potential for indexOutOfBoundsException so I converted it to list, that's more safe. Removing code again :)