@@ -184,17 +184,8 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
184184 * For example: for a function `int Foo(int p1, int p2)` this would
185185 * return `int p1, int p2`.
186186 */
187- string getParameterString ( ) { result = getParameterStringFrom ( 0 ) }
188-
189- private string getParameterStringFrom ( int index ) {
190- index = getNumberOfParameters ( ) and
191- result = ""
192- or
193- index = getNumberOfParameters ( ) - 1 and
194- result = min ( getParameter ( index ) .getTypedName ( ) )
195- or
196- index < getNumberOfParameters ( ) - 1 and
197- result = min ( getParameter ( index ) .getTypedName ( ) ) + ", " + getParameterStringFrom ( index + 1 )
187+ string getParameterString ( ) {
188+ result = concat ( int i | | min ( getParameter ( i ) .getTypedName ( ) ) , ", " order by i )
198189 }
199190
200191 /** Gets a call to this function. */
@@ -616,18 +607,8 @@ class FunctionDeclarationEntry extends DeclarationEntry, @fun_decl {
616607 * For example: for a function 'int Foo(int p1, int p2)' this would
617608 * return 'int p1, int p2'.
618609 */
619- string getParameterString ( ) { result = getParameterStringFrom ( 0 ) }
620-
621- private string getParameterStringFrom ( int index ) {
622- index = getNumberOfParameters ( ) and
623- result = ""
624- or
625- index = getNumberOfParameters ( ) - 1 and
626- result = min ( getParameterDeclarationEntry ( index ) .getTypedName ( ) )
627- or
628- index < getNumberOfParameters ( ) - 1 and
629- result =
630- min ( getParameterDeclarationEntry ( index ) .getTypedName ( ) ) + ", " + getParameterStringFrom ( index + 1 )
610+ string getParameterString ( ) {
611+ result = concat ( int i | | min ( getParameterDeclarationEntry ( i ) .getTypedName ( ) ) , ", " order by i )
631612 }
632613
633614 /**
0 commit comments