Within CFC cfinvoke function A or call function B
I'm looking for a best practice and have not found one as yet. Within a CFC I have a function A that needs results from function B. In the past, I have done both call (cfset) and cfinvoke. For memory or speed performance is there a clearly best approach? (oversimplified example here)
<cffunction name="functionB" access="private" output="no" returntype="numeric">
<cfargument name="myArg1" type="numeric" required="yes" >
<cfargument name="myArg2" type="numeric" required="yes" >
<cfset var retVal = myArg1 + myArg2>
<cfreturn retVal>
</cffunction>
<cffunction name="functionA" access="public" output="no" returntype="void">
<!---better this way--->
<cfset var sum1 = functionB(1,1)>
<!---or no difference--->
<cfinvoke method="functionB" returnvariable="sum2">
<cfinvokeargument name="myArg1" value="1"/>
<cfinvokeargument name="myArg2" value="1"/>
</cfinvoke>
<!---db query action here--->
</cffunction>
