[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Copying tables
- From: Mark Hamburg <mhamburg@...>
- Date: Tue, 10 Jun 2003 13:02:21 -0700
Is there an efficient way to copy Lua tables?
I've written the code which iterates the source table and adds the values to
the destination table and copies the metatable, but this all seems
relatively inefficient relative to explicitly saying "duplicate the
underlying data structures".
Is there a function that I've just missed?
(I've seen the lazy copy examples. That's vulnerable to having the source
table change out from under it. It also keeps alive references to all of the
data in the source table.)