RestKit/RKValueTransformers — pull request #17 by carllindberg (2014-11-20 06:03:40+00:00)
Title: Avoid creating error userInfo dictionaries when not needed

Make the value-checking macros avoid creating an error userInfo dictionary if the error is not going to be created (i.e. the given error reference pointer is NULL).

I had thought of an approach for RKCompoundValueTransformer to first go through the list with a NULL error parameter to see if any of the transformers can successfully convert a value, and if not then go back through all of them and collect the error instances. Right now if some initial transformers fail, the errors and containing array are all created, but will be thrown away if a subsequent valueTransformer succeeds. This approach would be the same as before if the first transformer succeeds, faster if only subsequent transforms succeed, and slower on failures. I did not have a decent test app for this scenario though so I don't know how much it would help in practice. So, just leaving this PR with the macro changes, which do help if NULL is passed (which RestKit almost never does, outside of RKObjectParameterization).