diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-05-05 01:54:31 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-07-14 23:57:12 +0300 |
commit | 6361dd32aaf567c8e03e4aa63006193dc67cca7b (patch) | |
tree | 39ebb954038b5697129b360badee8e9a679b4253 /core/src/main | |
parent | 3c6be4a1dbbcfec5e5438452f54857cce86d0d17 (diff) | |
download | dokka-6361dd32aaf567c8e03e4aa63006193dc67cca7b.tar.gz dokka-6361dd32aaf567c8e03e4aa63006193dc67cca7b.tar.bz2 dokka-6361dd32aaf567c8e03e4aa63006193dc67cca7b.zip |
Fix relative uri's generation
when there is matching trailing segments
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/Utilities/Uri.kt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Utilities/Uri.kt b/core/src/main/kotlin/Utilities/Uri.kt index 5b520188..9827c624 100644 --- a/core/src/main/kotlin/Utilities/Uri.kt +++ b/core/src/main/kotlin/Utilities/Uri.kt @@ -19,7 +19,7 @@ fun URI.relativeTo(uri: URI): URI { } // Compute common prefix - val commonPartsSize = bParts.zip(cParts).count { (basePart, childPart) -> basePart == childPart } + val commonPartsSize = bParts.zip(cParts).takeWhile { (basePart, childPart) -> basePart == childPart }.count() bParts.drop(commonPartsSize).joinTo(this, separator = "") { "../" } cParts.drop(commonPartsSize).joinTo(this, separator = "/") } |