diff options
author | Steven Barth <steven@midlink.org> | 2008-09-05 18:35:14 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-09-05 18:35:14 +0000 |
commit | 4483ebd74d57839b31175c8fa082b08c5330175a (patch) | |
tree | 4c9dbdb8fc2b9a22fb8f7881c1271d8ee67a1296 | |
parent | 6a6edda0491119cbba249bae847986313f8c09e0 (diff) |
Removed inefficient environment manipulation functions
-rw-r--r-- | libs/core/luasrc/util.lua | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua index c189c297ce..49a75be83a 100644 --- a/libs/core/luasrc/util.lua +++ b/libs/core/luasrc/util.lua @@ -118,37 +118,6 @@ end -- Scope manipulation routines -- ---- Replace a function scope with a shallow copy of itself. --- This is useful if you want to get rid of several unwanted side effects --- while changing the scope of a certain Lua function. --- @param f Lua function -function resfenv(f) - setfenv(f, clone(getfenv(f))) -end - ---- Store given object associated with given key in the scope of a function. --- @param f Lua function --- @param key String value containg the key of the object to store --- @param obj Object to store in the scope --- @return Always nil --- @see updfenv --- @see resfenv -function extfenv(f, key, obj) - local scope = getfenv(f) - scope[key] = obj -end - ---- Extend the scope of a function with the contents of a table --- @param f Lua function --- @param key String value containg the key of the object to store --- @param obj Object to store in the scope --- @return Always nil --- @see extfenv --- @see resfenv -function updfenv(f, extscope) - update(getfenv(f), extscope) -end - --- Create a new or get an already existing thread local store associated with -- the current active coroutine. A thread local store is private a table object -- whose values can't be accessed from outside of the running coroutine. |