Avoid concatenating lists of one string
This commit is contained in:
		
							parent
							
								
									e5c589d271
								
							
						
					
					
						commit
						767101824a
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		|  | @ -965,7 +965,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v) | ||||||
|             isPath = vStr.type == tPath; |             isPath = vStr.type == tPath; | ||||||
|             first = false; |             first = false; | ||||||
|         } |         } | ||||||
|              | 
 | ||||||
|         s << state.coerceToString(vStr, context, false, !isPath); |         s << state.coerceToString(vStr, context, false, !isPath); | ||||||
|     } |     } | ||||||
|          |          | ||||||
|  |  | ||||||
|  | @ -203,7 +203,7 @@ static Expr * stripIndentation(SymbolTable & symbols, vector<Expr *> & es) | ||||||
|         es2->push_back(new ExprString(symbols.create(s2))); |         es2->push_back(new ExprString(symbols.create(s2))); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return new ExprConcatStrings(es2); |     return es2->size() == 1 ? (*es2)[0] : new ExprConcatStrings(es2); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue