Variable names can be misleading
zhfei opened this issue · comments
zhfei commented
In the method:swizzleIfPossible, there is a variable name definition error that will be misleading.
IMP dzn_newImplementation = method_setImplementation(method, (IMP)dzn_original_implementation)
According to the method method_setImplementation definition:
/**
* Sets the implementation of a method.
*
* @param m The method for which to set an implementation.
* @param imp The implemention to set to this method.
*
* @return The previous implementation of the method.
*/
OBJC_EXPORT IMP _Nonnull
method_setImplementation(Method _Nonnull m, IMP _Nonnull imp)
The following definition is more appropriate:
IMP dzn_oldImplementation = method_setImplementation(method, (IMP)dzn_original_implementation);