Skip to content

Commit

Permalink
Shortened IMGUtils.GetRelativePath.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigETI committed Jun 18, 2018
1 parent d6d9cd1 commit 21f5485
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions IMGSharp/IMGUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ public static long GetNullTerminatedBytesLenghtFromBytes(byte[] bytes)
/// <returns>Relative path of "path"</returns>
public static string GetRelativePath(string path, string relativeToPath)
{
Uri path_uri = new Uri(path);
Uri relative_uri = new Uri(relativeToPath.EndsWith("\\") ? relativeToPath : (relativeToPath.EndsWith("/") ? relativeToPath : (relativeToPath + Path.DirectorySeparatorChar)));
return relative_uri.MakeRelativeUri(path_uri).ToString();
return (new Uri(relativeToPath.EndsWith("\\") ? relativeToPath : (relativeToPath.EndsWith("/") ? relativeToPath : (relativeToPath + Path.DirectorySeparatorChar)))).MakeRelativeUri(new Uri(path)).ToString();
}
}
}

0 comments on commit 21f5485

Please sign in to comment.