optimize generation of "-O gen-C++" code for table/vector size operations

This commit is contained in:
Vern Paxson 2024-04-08 17:11:58 -04:00 committed by Tim Wojtulewicz
parent 5311904bb1
commit 4e253aae0a

View file

@ -576,6 +576,9 @@ string CPPCompile::GenSizeExpr(const Expr* e, GenType gt) {
else if ( it == TYPE_INTERNAL_DOUBLE )
gen = string("fabs__CPP(") + gen + ")";
else if ( gt == GEN_NATIVE && (t1->Tag() == TYPE_TABLE || t1->Tag() == TYPE_VECTOR) )
return gen + "->Size()";
else
return GenericValPtrToGT(gen + "->SizeVal()", t, gt);