[darcs-users] [patch427] redundant use of when inside of an else

Florent Becker florent.becker at ens-lyon.org
Thu Nov 4 21:12:24 UTC 2010


Le 17/10/2010 18:11, gh a écrit :
> 
> New submission from gh <guillaumh at gmail.com>:
> 
> 1 patch for repository http://darcs.net:
> 
> Sun Oct 17 16:53:23 CEST 2010  Guillaume Hoffmann <guillaumh at gmail.com>
>   * redundant use of when inside of an else
---------------------------------------
Guillaume Hoffmann <guillaumh at gmail.com>**20101017145323

hunk ./src/Darcs/Lock.hs 257
>      do isd <- doesDirectoryReallyExist d
>         if not isd
>            then removeFile d
> -          else when isd $ do conts <- actual_dir_contents
> -                             withCurrentDirectory d $
> -                               mapM_ rmRecursive conts
> -                             removeDirectory d
> +          else do conts <- actual_dir_contents
> +                  withCurrentDirectory d $
> +                    mapM_ rmRecursive conts
> +                  removeDirectory d
>      where actual_dir_contents = -- doesn't include . or ..
>                do c <- getDirectoryContents d
>                   return $ filter (/=".") $ filter (/="..") c

Yes, it is a redundant use of when inside of an else ;-)

Applying, thanks

Florent



More information about the darcs-users mailing list