Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Variable names can be misleading #435

Open
zhfei opened this issue May 3, 2019 · 0 comments
Open

Variable names can be misleading #435

zhfei opened this issue May 3, 2019 · 0 comments

Comments

@zhfei
Copy link

zhfei commented May 3, 2019

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);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant