generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Difference between in next and in pairs

Previous Thread :: Next Thread 
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
15 Sep 2015 11:29 PM
^^^^^
And don't link me to wiki. Just tell me
Report Abuse
drager980 is not online. drager980
Joined: 25 May 2009
Total Posts: 13385
15 Sep 2015 11:32 PM
look at the wiki



AND THE TIGER GOES ROAR
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
15 Sep 2015 11:44 PM
next > pairs

pairs uses next, which means next is mroe effecient
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Sep 2015 12:04 AM
'next > pairs
pairs uses next, which means next is mroe effecient'

lol you contradicted your first statement with your second. Because pairs uses next, you can't say next is better than pairs because pairs just returns next.

The only difference is a single function call ONLY at the start of the loop.
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
16 Sep 2015 12:05 AM
I think pairs(table) is pretty much just unpack({next, table}). It returns the next iterator function and the table together as a tuple.
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
16 Sep 2015 12:14 AM
@cnt

wat

that's not contridicting especially if you are talking about effeciency

I was pretty much saying


pairs = next+more crap

therefore

next > pairs (effecieny wise)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Sep 2015 12:23 AM
pairs = next + a single function call, so no.
This difference is negligible, using ^.5 instead of math.sqrt a single time makes more of a difference than this like, a couple of times.
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
16 Sep 2015 12:23 AM
So they basically do the same thing? But in next is better
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
18 Sep 2015 11:12 PM
@cnt

I know it's really not any different,

but,

Why buy an apple that will expire a second earlier?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Sep 2015 11:13 PM
Why use a generic for loop when you can use a numerical for loop 80% of the time and it 'expires 2 days later' (aka MUCH more efficient)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image