Skip to content

Commit

Permalink
style: regexList naming
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Diger committed Sep 21, 2024
1 parent 5058f40 commit 7c8a84f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ShareUrlIdParser(
properties: AvocadoProperties,
) : AvocadoOriginMapIdParser {
private val regex: Regex = properties.url.regex.share.toRegex()
private val operateRegexList: List<Regex> =
private val mapIdRegexList: List<Regex> =
mutableListOf(
"place/(\\d+)".toRegex(),
"id=(\\d+)".toRegex(),
Expand All @@ -75,7 +75,7 @@ class ShareUrlIdParser(
.retrieve()
.toEntity(Map::class.java)
if (response.statusCode.is3xxRedirection && response.headers.location != null) {
return operateRegexList.firstNotNullOfOrNull { regex ->
return mapIdRegexList.firstNotNullOfOrNull { regex ->
regex.find(response.headers.location.toString())
?.groupValues?.getOrNull(1)?.let { OriginMapId(it) }
}
Expand Down

0 comments on commit 7c8a84f

Please sign in to comment.