From 0de562318229e709ceac6987df086849752434ec Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Mon, 8 Jul 2024 00:34:52 +0200 Subject: [PATCH] make some more optimizations when generating the output --- src/generator.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/generator.h b/src/generator.h index 250f739..4d9de98 100644 --- a/src/generator.h +++ b/src/generator.h @@ -2823,7 +2823,7 @@ void Generator::MakeEzcFr { StreamType * old_stream = output_stream; bool old_is_output_stream_allowed = is_output_stream_allowed; - bool put_directly_to_one_frame = false; + bool put_directly = false; bool is_current_frame_allowed = HasAskForSuchFrame(item.function); if( !is_output_stream_allowed && is_current_frame_allowed ) @@ -2836,10 +2836,19 @@ void Generator::MakeEzcFr /* * some optimization, put directly to the frame stream */ - put_directly_to_one_frame = true; + put_directly = true; output_stream = FindAddOutputStream(item.function.parameters[0]->name); } else + if( old_is_output_stream_allowed && !is_current_frame_allowed ) + { + /* + * some optimization, put directly to the old stream + */ + put_directly = true; + // do not modify output_stream here + } + else { output_stream = GetNewStreamForFrame(); } @@ -2849,7 +2858,7 @@ void Generator::MakeEzcFr if( !item.item_tab.empty() ) MakeText( *item.item_tab[0] ); // should be only one item - item_container - if( !put_directly_to_one_frame ) + if( !put_directly ) { if( old_is_output_stream_allowed ) {