[commit: packages/filepath] master: Remove unnecessary isDrive check in combineAlways (fd2f07f)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:35:16 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/fd2f07ffeb8480c2e0cae7ca7481a050a1060e93

>---------------------------------------------------------------

commit fd2f07ffeb8480c2e0cae7ca7481a050a1060e93
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Thu Oct 23 19:09:26 2014 +0200

    Remove unnecessary isDrive check in combineAlways
    
    `isWindows && isLetter a1` implies `isDrive [a1, ':']`


>---------------------------------------------------------------

fd2f07ffeb8480c2e0cae7ca7481a050a1060e93
 System/FilePath/Internal.hs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs
index 8e54138..417feec 100644
--- a/System/FilePath/Internal.hs
+++ b/System/FilePath/Internal.hs
@@ -602,10 +602,9 @@ combineAlways :: FilePath -> FilePath -> FilePath
 combineAlways a b | null a = b
                   | null b = a
                   | hasTrailingPathSeparator a = a ++ b
-                  | isDrive a = case a of
+                  | otherwise = case a of
                       [a1,':'] | isWindows && isLetter a1 -> a ++ b
                       _ -> a ++ [pathSeparator] ++ b
-                  | otherwise = a ++ [pathSeparator] ++ b
 
 
 -- | A nice alias for 'combine'.



More information about the ghc-commits mailing list