Create callback

Thks for the pro-tips, very helpful, comparing with toString()and getParameterTypes().

But about comparaison, i’m not sure I can in my case to use it by your way.
In this case when I call method from void method(String name, PApplet pa, Object... args) it not a method, so i cannot compare with a method except if create this one.

I’ve just changed that to simply use equals(). toString() isn’t necessary after all! :money_mouth_face:

Indeed! But you can still create a Method just to check whether it’s the same you already have, then discard it if it is so. :wastebasket:

it’s an option, just know which is a faster way for CPU ?

Your existing check algorithm is already complex anyways. :no_mouth:

My guess is that using Class::getMethod() and then iterating over your stored Method objects calling equals() won’t be any slower than what you’ve already got. :thinking:

And add to that the bonus of significantly cutting off a lot of the size of your big code. :haircut_man:

1 Like