<commit_before>#include "loopBlock.h"

using namespace qReal;
using namespace interpreters::robots::details::blocks;

LoopBlock::LoopBlock()
	: mIterationStartBlock(NULL)
	, mIterations(0)
{
}

void LoopBlock::run()
{
	if (mIterations <= 0)
		emit done(mNextBlock);
	else
		emit done(mIterationStartBlock);
	--mIterations;
}

bool LoopBlock::initNextBlocks()
{
	bool iterationFound = false;
	bool nextFound = false;

	IdList const links = mGraphicalModelApi->graphicalRepoApi().outgoingLinks(id());

	foreach (Id const linkId, links) {<commit_msg>Fix for a crash when looping thru synchronous piece of model.<commit_after>#include "loopBlock.h"

using namespace qReal;
using namespace interpreters::robots::details::blocks;

LoopBlock::LoopBlock()
	: mIterationStartBlock(NULL)
	, mIterations(0)
{
}

void LoopBlock::run()
{
	--mIterations;
	if (mIterations <= 0)
		emit done(mNextBlock);
	else
		emit done(mIterationStartBlock);
}

bool LoopBlock::initNextBlocks()
{
	bool iterationFound = false;
	bool nextFound = false;

	IdList const links = mGraphicalModelApi->graphicalRepoApi().outgoingLinks(id());

	foreach (Id const linkId, links) {
{'fraction_non_alphanumeric': 0.1234676007005254, 'fraction_numerical': 0.0035026269702276708, 'mean_word_length': 6.14375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4630057', 'n_tokens_mistral': 398, 'n_tokens_neox': 381, 'n_words': 88}