Actually avoid sending +initialize to all classes when looking for ones we want to swizzle.
Actually avoid sending +initialize to all classes when looking for ones we want to swizzle.

class_getInstanceMethod() causes +initialize to classes if they haven’t already received it. By using class_copyMethodList() instead, we avoid +initialize unless we’re actually going to swizzle methods on the class.

This change also takes the running time of the main injection method from ~400 ms to ~50 ms on an iPhone 6. Presumably that’s from +initialize methods that are no longer running here.

tttpeng/FLEX,appspector/FLEX,iBcker/FLEX,jdk89757/FLEX,hoaquo/FLEX,deer-hope/FLEX,evliu/FLEX,ramoslin02/FLEX,fbernardo/FLEX,Kingside/FLEX,programming086/FLEX,msdgwzhy6/FLEX,lintaoSuper/FLEX,otatime/FLEX,hugo-/FLEX,zhaoguohui/FLEX,Flipboard/FLEX,NSExceptional/FLEX,Suninus/FLEX,erichoracek/FLEX,Automatic/FLEX,pjebs/FLEX,Flipboard/FLEX,BrianBatchelder/FLEX,NSExceptional/FLEX,sunfei/FLEX,Xiaobin0860/FLEX,tttpeng/FLEX-DatabaseBrowser,DaidoujiChen/FLEX