Jump to content

Splice vs destroy


pdiddles03
 Share

Recommended Posts

If you are calling destroy on an object it is because you are done with an object, done in such a way that it will never be used again. If you are pooling what you do is when you are done with an object you add it to the pool, and when you need an object you grab it  from the pool. You don't destroy it because it will be used again at some point. If you are pooling, you shouldn't be destroying objects.

Link to comment
Share on other sites

Ok so I am using shift and unshift to remove and add objects back to the pool. Sometimes I put the pool object into another array, why would you suggest is the best solution to remove that from the new array and put back into the pool array? My problem is I don't want to create another array because some of the methods do.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...