Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
luvit_init: remove function call from assert()
Fix #156.

assert() statements can be compiled out, don't do functional things in
them.

Note from Brandon: I searched the rest of the tree for assert() with
side effects and didn't see anything else.
  • Loading branch information
AndrewTsao authored and philips committed May 23, 2012
1 parent 95c2503 commit 153fefa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/luvit_init.c
Expand Up @@ -245,7 +245,8 @@ int luvit_init(lua_State *L, uv_loop_t* loop, int argc, char *argv[])
#endif

/* Hold a reference to the main thread in the registry */
assert(lua_pushthread(L) == 1);
rc = lua_pushthread(L);
assert(rc == 1);
lua_setfield(L, LUA_REGISTRYINDEX, "main_thread");

/* Store the loop within the registry */
Expand Down

0 comments on commit 153fefa

Please sign in to comment.