From e93440bd4a520ab81203e8b0105ac43323f67e6b Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Fri, 3 Oct 2014 21:29:56 +0400 Subject: Constructors, variance, links and styles. --- src/Locations/LocationService.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Locations') diff --git a/src/Locations/LocationService.kt b/src/Locations/LocationService.kt index 277169fd..f89fedd0 100644 --- a/src/Locations/LocationService.kt +++ b/src/Locations/LocationService.kt @@ -14,14 +14,12 @@ public trait LocationService { public fun escapeUri(path: String): String = path.replace('<', '_').replace('>', '_') -fun LocationService.relativeLocation(node: DocumentationNode, link: DocumentationNode, extension: String): Location { - val ownerFolder = location(node).file.getParentFile()!! - val memberPath = location(link).file.appendExtension(extension) - return Location(ownerFolder.getRelativePath(memberPath)) +fun LocationService.relativeLocation(owner: DocumentationNode, node: DocumentationNode, extension: String): Location { + return relativeLocation(location(owner), node, extension) } -fun LocationService.relativeLocation(location: Location, link: DocumentationNode, extension: String): Location { - val ownerFolder = location.file.getParentFile()!! - val memberPath = location(link).file.appendExtension(extension) +fun LocationService.relativeLocation(owner: Location, node: DocumentationNode, extension: String): Location { + val ownerFolder = owner.file.getParentFile()!! + val memberPath = location(node).file.appendExtension(extension) return Location(ownerFolder.getRelativePath(memberPath)) } -- cgit