mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
fix: remove unnecessary latLng variable and return null directly
This commit is contained in:
parent
e81abaa1e4
commit
10479a01b7
1 changed files with 2 additions and 2 deletions
|
|
@ -16,12 +16,12 @@ object LocationUtils {
|
|||
val indexOfPrefix = customQuery.indexOf("Point(")
|
||||
if (indexOfPrefix == -1) {
|
||||
Timber.e("Invalid prefix index - Seems like user has entered an invalid query")
|
||||
return latLng
|
||||
return null
|
||||
}
|
||||
val indexOfSuffix = customQuery.indexOf(")\"", indexOfPrefix)
|
||||
if (indexOfSuffix == -1) {
|
||||
Timber.e("Invalid suffix index - Seems like user has entered an invalid query")
|
||||
return latLng
|
||||
return null
|
||||
}
|
||||
val latLngString = customQuery.substring(indexOfPrefix + "Point(".length, indexOfSuffix)
|
||||
if (latLngString.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue