Switch more uniqFromSupply+splitUniqSupply's to takeUniqFromSupply
[ghc-hetmet.git] / compiler / iface / BinIface.hs
index 9cc824a..f7a9aa2 100644 (file)
@@ -256,22 +256,20 @@ fromOnDiskName
    -> OnDiskName
    -> (NameCache, Name)
 fromOnDiskName _ nc (pid, mod_name, occ) =
-  let 
+  let
         mod   = mkModule pid mod_name
         cache = nsNames nc
   in
   case lookupOrigNameCache cache  mod occ of
      Just name -> (nc, name)
-     Nothing   -> 
-        let 
-                us        = nsUniqs nc
-                uniq      = uniqFromSupply us
+     Nothing   ->
+        case takeUniqFromSupply (nsUniqs nc) of
+        (uniq, us) ->
+            let
                 name      = mkExternalName uniq mod occ noSrcSpan
                 new_cache = extendNameCache cache mod occ name
-        in        
-        case splitUniqSupply us of { (us',_) -> 
-        ( nc{ nsUniqs = us', nsNames = new_cache }, name )
-        }
+            in
+            ( nc{ nsUniqs = us, nsNames = new_cache }, name )
 
 serialiseName :: BinHandle -> Name -> UniqFM (Int,Name) -> IO ()
 serialiseName bh name _ = do