vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:36 PM |
Since :ClearAllChildren() uses the deprecated :remove() method is the chunk below the best way to properly destroy all children??
for i,v in ipairs(model:GetChildren()) do v:Destroy() end
|
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:36 PM |
| Apologies about the title .. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 16 Apr 2015 11:37 PM |
i head ipairs is slightly slower than in pairs or in next
|
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:38 PM |
| But ipairs keeps looping till v = nil right? Or is there a better way?? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 16 Apr 2015 11:38 PM |
*i heard
gah, floodchecks
and my bad typing skills |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 16 Apr 2015 11:39 PM |
and yes, you are correct
ipairs stops when v is nil |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:40 PM |
| I think the night is slowly creeping into all of our heads.. |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:41 PM |
Thank you!
a little antecedent action: I was using :ClearAllChildren() and apprantly it uses the remove method which stores the stuffz in memory, that expalins the lag, now imma go fix eet
gud nite |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 16 Apr 2015 11:42 PM |
ipairs is still stupid <3
pairs will always be master race
fank u allah 4 the gift of pairs |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:46 PM |
| ipairs won't miss anything?? |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 16 Apr 2015 11:47 PM |
| I mean, "Pairs" gash ok now bye |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Apr 2015 11:57 PM |
'ipairs is still stupid <3 pairs will always be master race'
Considering they are for different purposes, that's a dumb remark |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 16 Apr 2015 11:58 PM |
| Considering pairs works similarly as ipairs but is more efficient, your remark is stupid. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 17 Apr 2015 12:01 AM |
it probably should be noted that ipairs is used when the order that you iterate through the table matters
so it has its uses |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Apr 2015 12:03 AM |
'Considering pairs works similarly as ipairs but is more efficient, your remark is stupid.' You obviously have no idea how they work in that case. |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 17 Apr 2015 12:03 AM |
mayB 4 reversin chur tables m8
most cases its useless tho |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Apr 2015 12:41 AM |
| The speed difference across using pairs rather than ipairs is negligible, especially compared to the difference by using a numerical for loop to iterate. So in most cases: both pairs and ipairs are slow and useless. |
|
|
| Report Abuse |
|
|