Kaynağa Gözat

Remove 'assert' expression

If the program is compiled with NDEBUG macro defined, those expressions will be deleted.
Ole 9 yıl önce
ebeveyn
işleme
7c0f7189a1
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      lib/luwra/auxiliary.hpp

+ 4 - 4
lib/luwra/auxiliary.hpp

@@ -53,7 +53,7 @@ void setMetatable(State* state, const char* name) {
  */
 template <typename V> static inline
 void setGlobal(State* state, const std::string& name, V value) {
-	assert(1 == push(state, value));
+	push(state, value);
 	lua_setglobal(state, name.c_str());
 }
 
@@ -87,8 +87,8 @@ namespace internal {
 	struct EntryPusher<K, V> {
 		static inline
 		void push(State* state, int index, K&& key, V&& value) {
-			assert(1 == luwra::push(state, key));
-			assert(1 == luwra::push(state, value));
+			luwra::push(state, key);
+			luwra::push(state, value);
 			lua_rawset(state, index < 0 ? index - 2 : index);
 		}
 	};
@@ -150,7 +150,7 @@ V getField(State* state, int index, K key) {
 	if (index < 0)
 		index = lua_gettop(state) + (index + 1);
 
-	assert(push<K>(state, key) == 1);
+	push<K>(state, key);
 	lua_rawget(state, index);
 
 	V value = read<V>(state, -1);