Software /
code /
prosody
Comparison
util-src/strbitop.c @ 11171:2c1583bb0e0f 0.11
util.strbitop: Remove redundant init function
When you have 3 almost identical functions, you tend to edit one and
then copypaste. Forgot to remove this line from the other two.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 15 Oct 2020 17:05:53 +0200 |
parent | 11169:6dde2c9fa272 |
child | 11172:712b2e6a09d9 |
comparison
equal
deleted
inserted
replaced
11169:6dde2c9fa272 | 11171:2c1583bb0e0f |
---|---|
18 luaL_Buffer buf; | 18 luaL_Buffer buf; |
19 size_t a, b, i; | 19 size_t a, b, i; |
20 const char *str_a = luaL_checklstring(L, 1, &a); | 20 const char *str_a = luaL_checklstring(L, 1, &a); |
21 const char *str_b = luaL_checklstring(L, 2, &b); | 21 const char *str_b = luaL_checklstring(L, 2, &b); |
22 | 22 |
23 luaL_buffinit(L, &buf); | |
24 | |
25 if(a == 0 || b == 0) { | 23 if(a == 0 || b == 0) { |
26 lua_settop(L, 1); | 24 lua_settop(L, 1); |
27 return 1; | 25 return 1; |
28 } | 26 } |
29 | 27 |
41 int strop_or(lua_State *L) { | 39 int strop_or(lua_State *L) { |
42 luaL_Buffer buf; | 40 luaL_Buffer buf; |
43 size_t a, b, i; | 41 size_t a, b, i; |
44 const char *str_a = luaL_checklstring(L, 1, &a); | 42 const char *str_a = luaL_checklstring(L, 1, &a); |
45 const char *str_b = luaL_checklstring(L, 2, &b); | 43 const char *str_b = luaL_checklstring(L, 2, &b); |
46 | |
47 luaL_buffinit(L, &buf); | |
48 | 44 |
49 if(a == 0 || b == 0) { | 45 if(a == 0 || b == 0) { |
50 lua_settop(L, 1); | 46 lua_settop(L, 1); |
51 return 1; | 47 return 1; |
52 } | 48 } |