2 comments

[ 3.6 ms ] story [ 18.4 ms ] thread
android::ContextualSearchLayer::SetProperties(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, float, scoped_refptr<cc::Layer> const&, bool, float, float, int, int, bool, float, float, int, int, bool, float, bool, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, bool, bool, float, bool, bool, float, int, int, int, float, bool, float, float, float, bool, float, float, int, int)
My first reaction to this would be to change it to take as struct, but the ticket comments reveal why this is not a good idea: those are C++ functions called from Java, and Java's translation layer (JNI) does not support structs at all.

It looks like the "recommended" case would be to create a new class, add a setter for each parameter, and pass it. But this is a lot of extra code, and many more function calls, which will slow down the program.

If I were in their shoes, I would keep it as-is, but add an explanation comment. If this patter turns out to be both common and error-prone, I'd consider codegen which emits definition of C++ struct, Java caller and C++ receiver with matching parameter list.