Browse Source

HPCC-17202 Improve code for short const sets of variable length strings

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 years ago
parent
commit
4282eedea3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ecl/hqlcpp/hqlcpp.cpp

+ 2 - 1
ecl/hqlcpp/hqlcpp.cpp

@@ -7874,7 +7874,8 @@ void HqlCppTranslator::doBuildAssignList(BuildCtx & ctx, const CHqlBoundTarget &
 
     //This is an assignment, a non-constant set would end up creating two temporaries.
     unsigned numItems = expr->numChildren();
-    if (((numItems > 0) && (numItems < 3)) || isComplexSet(expr) || !isConstantSet(expr))
+    ITypeInfo * elementType = type->queryChildType();
+    if (((numItems > 0) && (numItems < 3) && !isUnknownSize(elementType)) || isComplexSet(expr) || !isConstantSet(expr))
     {
         Owned<IHqlCppSetBuilder> builder = createTempSetBuilder(target.queryType()->queryChildType(), target.isAll);
         builder->buildDeclare(ctx);