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

Commit da01ccf

Browse files
committed
libscript: Spanify MCScriptExecuteContext::ThrowUnableToResolveMultiInvoke
1 parent 9a243e0 commit da01ccf

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

libscript/src/script-bytecode.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ struct MCScriptBytecodeOp_Invoke
437437
if (t_min_score_ambiguous || t_min_score_definition == NULL)
438438
{
439439
ctxt.ThrowUnableToResolveMultiInvoke(p_group,
440-
p_arguments,
441-
p_argument_count);
440+
MCMakeSpan(p_arguments, p_argument_count));
442441
return;
443442
}
444443

libscript/src/script-execute.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ class MCScriptExecuteContext
202202

203203
// Raise an 'unable to resolve multi-invoke' error.
204204
void ThrowUnableToResolveMultiInvoke(MCScriptDefinitionGroupDefinition *group,
205-
const uindex_t *arguments,
206-
uindex_t argument_count);
205+
MCSpan<const uindex_t> arguments);
207206

208207
// Raise a 'value is not a handler' error.
209208
void ThrowNotAHandlerValue(MCValueRef actual_value);
@@ -1237,14 +1236,13 @@ MCScriptExecuteContext::Rethrow(bool /*ignored*/)
12371236

12381237
inline void
12391238
MCScriptExecuteContext::ThrowUnableToResolveMultiInvoke(MCScriptDefinitionGroupDefinition *p_group,
1240-
const uindex_t *p_arguments,
1241-
uindex_t p_argument_count)
1239+
MCSpan<const uindex_t> p_arguments)
12421240
{
12431241
MCAutoProperListRef t_args;
12441242
if (!MCProperListCreateMutable(&t_args))
12451243
return;
12461244

1247-
for(uindex_t i = 0; i < p_argument_count; i++)
1245+
for(uindex_t i = 0; i < p_arguments.size(); i++)
12481246
{
12491247
MCValueRef t_value;
12501248
t_value = FetchRegister(p_arguments[i]);

0 commit comments

Comments
 (0)