|
|
@@ -48,9 +48,9 @@ void setMetatable(State* state, const char* name) {
|
|
|
* \param value Global value
|
|
|
*/
|
|
|
template <typename V> static inline
|
|
|
-void setGlobal(State* state, const std::string& name, V&& value) {
|
|
|
+void setGlobal(State* state, const char* name, V&& value) {
|
|
|
push(state, std::forward<V>(value));
|
|
|
- lua_setglobal(state, name.c_str());
|
|
|
+ lua_setglobal(state, name);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -60,8 +60,8 @@ void setGlobal(State* state, const std::string& name, V&& value) {
|
|
|
* \returns Value associated with the given name
|
|
|
*/
|
|
|
template <typename V> static inline
|
|
|
-V getGlobal(State* state, const std::string& name) {
|
|
|
- lua_getglobal(state, name.c_str());
|
|
|
+V getGlobal(State* state, const char* name) {
|
|
|
+ lua_getglobal(state, name);
|
|
|
|
|
|
V instance = read<V>(state, -1);
|
|
|
lua_pop(state, 1);
|