Skip to content

Commit

Permalink
Simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu committed Jun 11, 2024
1 parent c1a50e9 commit 0525c35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ internal fun String.toJsonOrNull(): JSONObject? =
null
}

/**
* Percent-decodes a string.
*/
internal fun String.percentDecoded(): String =
Uri.decode(this)

/**
* Percent-encodes an URL path section.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import kotlinx.parcelize.Parcelize
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.isPrintableAscii
import org.readium.r2.shared.extensions.percentDecoded
import org.readium.r2.shared.extensions.percentEncodedPath
import org.readium.r2.shared.extensions.tryOrNull

Expand Down Expand Up @@ -269,7 +268,7 @@ public class AbsoluteUrl private constructor(override val uri: Uri) : Url() {

return scheme == other.scheme &&
uri.authority == other.uri.authority &&
path?.percentDecoded() == other.path?.percentDecoded() &&
path == other.path &&
query == other.query &&
fragment == other.fragment
}
Expand Down Expand Up @@ -304,7 +303,7 @@ public class RelativeUrl private constructor(override val uri: Uri) : Url() {

other as RelativeUrl

return path?.percentDecoded() == other.path?.percentDecoded() &&
return path == other.path &&
query == other.query &&
fragment == other.fragment
}
Expand Down

0 comments on commit 0525c35

Please sign in to comment.