Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 222b5dc

Browse files
committed
Use range-based for when iterating over spans
1 parent ae1601e commit 222b5dc

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

engine/src/variable.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,11 @@ __join_paths(MCSpan<MCNameRef> p_base,
11241124
new (nothrow) MCNameRef[p_base.size() + p_extra.size()];
11251125
if (t_result)
11261126
{
1127-
for(int i = 0; i < p_base.size(); i++)
1128-
t_result[i] = p_base[i];
1129-
1130-
for(int i = 0; i < p_extra.size(); i++)
1131-
t_result[i + p_base.size()] = p_extra[i];
1127+
int t_count = 0;
1128+
for (MCNameRef t_name : p_base)
1129+
t_result[t_count++] = t_name;
1130+
for (MCNameRef t_name : p_extra)
1131+
t_result[t_count++] = t_name;
11321132
}
11331133

11341134
return std::move(t_result);

libscript/src/script-execute.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,11 +1233,11 @@ MCScriptExecuteContext::ThrowUnableToResolveMultiInvoke(MCScriptDefinitionGroupD
12331233
MCAutoProperListRef t_args;
12341234
if (!MCProperListCreateMutable(&t_args))
12351235
return;
1236-
1237-
for(uindex_t i = 0; i < p_arguments.size(); i++)
1238-
{
1236+
1237+
for (const uindex_t t_argument : p_arguments)
1238+
{
12391239
MCValueRef t_value;
1240-
t_value = FetchRegister(p_arguments[i]);
1240+
t_value = FetchRegister(t_argument);
12411241

12421242
if (t_value == nil)
12431243
{

0 commit comments

Comments
 (0)