|
| 15 Sep 2015 11:29 PM |
^^^^^ And don't link me to wiki. Just tell me |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 15 Sep 2015 11:44 PM |
next > pairs
pairs uses next, which means next is mroe effecient |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 16 Sep 2015 12:23 AM |
| So they basically do the same thing? But in next is better |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|