@@ -559,32 +559,32 @@ static bool insert_input_converters(py_phlex_module* mod,
559559 return false ;
560560 }
561561
562- pos += 18 ;
563-
562+ std::string suffix = inp_type.substr (pos);
564563 std::string py_out = cname + " _" + inp + " py" ;
565- if (inp_type.compare (pos, std::string::npos, " int32]]" ) == 0 ) {
566- mod->ph_module ->transform (" pyvint_" + inp + " _" + cname, vint_to_py, concurrency::serial)
567- .input_family (product_query{product_specification::create (inp), LAYER})
568- .output_products (py_out);
569- } else if (inp_type.compare (pos, std::string::npos, " uint32]]" ) == 0 ) {
564+
565+ if (suffix.find (" uint32]]" ) != std::string::npos) {
570566 mod->ph_module ->transform (" pyvuint_" + inp + " _" + cname, vuint_to_py, concurrency::serial)
571567 .input_family (product_query{product_specification::create (inp), LAYER})
572568 .output_products (py_out);
573- } else if (inp_type. compare (pos, std::string::npos, " int64]] " ) == 0 ) { // need not be true
574- mod->ph_module ->transform (" pyvlong_ " + inp + " _" + cname, vlong_to_py , concurrency::serial)
569+ } else if (suffix. find ( " int32]] " ) != std::string::npos) {
570+ mod->ph_module ->transform (" pyvint_ " + inp + " _" + cname, vint_to_py , concurrency::serial)
575571 .input_family (product_query{product_specification::create (inp), LAYER})
576572 .output_products (py_out);
577- } else if (inp_type. compare (pos, std::string::npos, " uint64]]" ) == 0 ) { // id.
573+ } else if (suffix. find ( " uint64]]" ) != std::string::npos ) { // id.
578574 mod->ph_module
579575 ->transform (" pyvulong_" + inp + " _" + cname, vulong_to_py, concurrency::serial)
580576 .input_family (product_query{product_specification::create (inp), LAYER})
581577 .output_products (py_out);
582- } else if (inp_type.compare (pos, std::string::npos, " float32]]" ) == 0 ) {
578+ } else if (suffix.find (" int64]]" ) != std::string::npos) { // need not be true
579+ mod->ph_module ->transform (" pyvlong_" + inp + " _" + cname, vlong_to_py, concurrency::serial)
580+ .input_family (product_query{product_specification::create (inp), LAYER})
581+ .output_products (py_out);
582+ } else if (suffix.find (" float32]]" ) != std::string::npos) {
583583 mod->ph_module
584584 ->transform (" pyvfloat_" + inp + " _" + cname, vfloat_to_py, concurrency::serial)
585585 .input_family (product_query{product_specification::create (inp), LAYER})
586586 .output_products (py_out);
587- } else if (inp_type. compare (pos, std::string::npos, " double64 ]]" ) == 0 ) {
587+ } else if (suffix. find ( " float64 ]]" ) != std::string::npos ) {
588588 mod->ph_module
589589 ->transform (" pyvdouble_" + inp + " _" + cname, vdouble_to_py, concurrency::serial)
590590 .input_family (product_query{product_specification::create (inp), LAYER})
0 commit comments