simplify
authorJoey Hess <joeyh@joeyh.name>
Thu, 20 Feb 2020 22:22:31 +0000 (18:22 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 20 Feb 2020 22:22:31 +0000 (18:22 -0400)
Backend/Hash.hs

index 5465f05c3e01340e3466ba946a0a9ad43e799f49..e8fea3c035e94663c12d531a4398228086153ba8 100644 (file)
@@ -156,9 +156,7 @@ keyHash = fst . splitKeyNameExtension
 
 validInExtension :: Word8 -> Bool
 validInExtension c
-       | c >= 48 && c <= 57 = True -- numbers
-       | c >= 65 && c <= 90 = True -- A-Z
-       | c >= 97 && c <= 122 = True -- a-z
+       | isAlphaNum (chr (fromIntegral c)) = True
        | c <= 127 = False -- other ascii, spaces, punctuation, control chars
        | otherwise = True -- utf8 is allowed, also other encodings