Matthew Wild
7f748556a2
util.strbitop: Add common_prefix_bits() method
...
This returns the number of bits that two strings have in common. It is
significantly more efficient than similar calculations in Lua.
2 years ago
Kim Alvefur
8136aa749a
util: Add compat for prosody module name change to C sources
3 years ago
Kim Alvefur
dff4beae02
util-src: Remove Lua 5.1 compat macros
...
Part of #1600
4 years ago
Kim Alvefur
787835d693
util.strbitop: Reduce scope of functions
...
Equivalent to 'local' in Lua, these functions are exported via the
luaopen_ function, which is the only one needing to be visible outside
of the file.
Pointed out by Link Mauve at some point, but there wasn't really any
rush here.
4 years ago
Kim Alvefur
20fc0c9c15
Back out changeset 2c1583bb0e0f
...
Same reason as 712b2e6a09d9
5 years ago
Kim Alvefur
bad47be8f9
Back out 6dde2c9fa272: Doesn't work on Lua 5.1
5 years ago
Kim Alvefur
9b8a54345f
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.
5 years ago
Kim Alvefur
da8eca639a
util.strbitop: Create buffer in the correct size (optimization)
...
This avoids dynamically growing the buffer as Lua does when luaL_addchar
is used, thus saving on realloc calls.
5 years ago
Kim Alvefur
539255c692
util.strbitop: Reformat code
...
astyle \
--indent=tab \
--attach-classes \
--indent-switches \
--break-blocks \
--pad-oper \
--unpad-paren \
--add-braces \
--align-pointer=name \
--lineend=linux \
*.c
5 years ago
Kim Alvefur
fb1808b185
util.strbitop: Library for bitwise operations on strings
6 years ago