Skip to content

Commit

Permalink
Improve code style - use String#split
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaszKontowski committed Oct 17, 2022
1 parent b7f601c commit c6c43a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ case class IntelliJPatternResolver(pattern: String) extends IntelliJResolver {
private def replaceFirstFoundWildcardWithDirectories(path: String): List[String] = {
def removeLastFileSeparator(path: String): String = if (path.endsWith("/")) path.init else path

val pathUntilWildcard = Paths.get(path.substring(0, path.indexOf('*')).replace("file:", ""))
val stringPathAfterWildcard = path.substring(path.indexOf('*') + 1)
val Array(stringPathUntilWildcard, stringPathAfterWildcard) = path.split("*", 2)
val pathUntilWildcard = Paths.get(stringPathUntilWildcard.replace("file:", ""))

if (pathUntilWildcard.exists) {
pathUntilWildcard
Expand Down

0 comments on commit c6c43a4

Please sign in to comment.