Skip to content

Commit fdde057

Browse files
committed
don't use a loop when you can just pass in the arguments as an argumentCollection
1 parent 40ffaf4 commit fdde057

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

javaloader/JavaLoader.cfc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,14 @@ Purpose: Utlitity class for loading Java Classes
179179
</cfscript>
180180

181181
<cfif isSimpleValue(arguments[1])>
182-
<cfinvoke method="#arguments[1]#" returnvariable="local.return">
183-
<cfloop collection="#local.funcArgs#" item="local.i">
184-
<cfinvokeargument name="#local.i#" value="#local.funcArgs[local.i]#" />
185-
</cfloop>
186-
</cfinvoke>
182+
<cfinvoke method="#arguments[1]#" returnvariable="local.return" argumentCollection="#local.funcArgs#" />
187183
<cfelseif isCustomFunction(arguments[1])>
188184
<cfscript>
189185
local.func = arguments[1];
190186
local.return = local.func(argumentCollection = funcArgs);
191187
</cfscript>
192188
<cfelseif isObject(arguments[1]) AND isSimpleValue(arguments[2])>
193-
<cfinvoke component="#arguments[1]#" method="#arguments[2]#" returnvariable="local.return">
194-
<cfloop collection="#local.funcArgs#" item="local.i">
195-
<cfinvokeargument name="#local.i#" value="#local.funcArgs[local.i]#" />
196-
</cfloop>
197-
</cfinvoke>
189+
<cfinvoke component="#arguments[1]#" method="#arguments[2]#" returnvariable="local.return" argumentCollection="#local.funcArgs#" />
198190
<cfelse>
199191
<cfthrow type="javaloader.InvalidInvocationException" message="Unable to determine what method to invoke" detail="Please check the documentation for switchThreadContextClassLoader."/>
200192
</cfif>

0 commit comments

Comments
 (0)