Confusing double use of chooseRep in runHandler

I believe there may be an unneeded pass through chooseRep in at the end of runHandler in the HCContent branch of the content case construct HCContent status a -> do (ct, c) <- liftIO $ chooseRep a cts return $ YARPlain status (headers []) ct c finalSession The chooseRep instance will just be id as a is already of type ChooseRep. While I doubt there would be any performance benefit, as I would hope it is optimized out, it did cause me some confusion while reading to code, so think it would be worth removing for clarity. I've attached a patch for this. Cheers! -Tyson

On Wed, Jun 8, 2011 at 11:59 PM, Tyson Whitehead
I believe there may be an unneeded pass through chooseRep in at the end of runHandler in the HCContent branch of the content case construct
HCContent status a -> do (ct, c) <- liftIO $ chooseRep a cts return $ YARPlain status (headers []) ct c finalSession
The chooseRep instance will just be id as a is already of type ChooseRep.
While I doubt there would be any performance benefit, as I would hope it is optimized out, it did cause me some confusion while reading to code, so think it would be worth removing for clarity. I've attached a patch for this.
You're absolutely correct, thanks for pointing this out. Patch applied. Michael
participants (2)
-
Michael Snoyman
-
Tyson Whitehead