File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -792,12 +792,8 @@ p5.prototype.selectInput = function () {
792792 * in as first argument
793793 */
794794p5 . prototype . httpGet = function ( ) {
795- var args = new Array ( arguments . length ) ;
796- args [ 0 ] = arguments [ 0 ] ;
797- args [ 1 ] = 'GET' ;
798- for ( var i = 1 ; i < arguments . length ; ++ i ) {
799- args [ i + 1 ] = arguments [ i ] ;
800- }
795+ var args = Array . prototype . slice . call ( arguments ) ;
796+ args . splice ( 1 , 0 , 'GET' ) ;
801797 p5 . prototype . httpDo . apply ( this , args ) ;
802798} ;
803799
@@ -818,12 +814,8 @@ p5.prototype.httpGet = function () {
818814 * in as first argument
819815 */
820816p5 . prototype . httpPost = function ( ) {
821- var args = new Array ( arguments . length ) ;
822- args [ 0 ] = arguments [ 0 ] ;
823- args [ 1 ] = 'POST' ;
824- for ( var i = 1 ; i < arguments . length ; ++ i ) {
825- args [ i + 1 ] = arguments [ i ] ;
826- }
817+ var args = Array . prototype . slice . call ( arguments ) ;
818+ args . splice ( 1 , 0 , 'POST' ) ;
827819 p5 . prototype . httpDo . apply ( this , args ) ;
828820} ;
829821
You can’t perform that action at this time.
0 commit comments