Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterators are verbose; range-based for loops are not #26

Open
ReiquelApplegate opened this issue Apr 18, 2024 · 2 comments
Open

iterators are verbose; range-based for loops are not #26

ReiquelApplegate opened this issue Apr 18, 2024 · 2 comments

Comments

@ReiquelApplegate
Copy link
Contributor

DataStructs.cpp could use some range-based for loops

@wilsonpe66
Copy link

Agreeed

see the following:

FunctionData::FunctionData(Program& program)
	: program(program),
	  globalData(program.getScope().getLocalData())
{
	for (const auto it : globalData)
	{
		Datum& datum = *it;
		if (!datum.getCompileTimeValue())
		{
			globalVariables.push_back(&datum);
		}
	}

	for (const auto script : program.scripts)
	{
		const vector<Datum*> data = script->getScope().getLocalData();
		globalVariables.insert(globalVariables.end(),
		                       data.begin(), data.end());
	}
	
	for (const auto it : program.namespaces)
	{
		const auto & data = it->getScope().getLocalData();
		globalVariables.insert(globalVariables.end(),
		                       data.begin(), data.end());
	}
}

@wilsonpe66
Copy link

see the following pr #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants