aboutsummaryrefslogtreecommitdiff
path: root/src/lj_bcwrite.c
diff options
context:
space:
mode:
authorMike Pall <mike>2012-08-26 19:41:35 +0200
committerMike Pall <mike>2012-08-26 19:41:35 +0200
commitc0efa6f00ed757bc05d3a0874f98c91fcb88dc68 (patch)
treeead5e444f8385b5f6e3ee8c0822268a287437f73 /src/lj_bcwrite.c
parentcf3a2630443e3522d68c62a184df11ad1914ec44 (diff)
downloadluajit-c0efa6f00ed757bc05d3a0874f98c91fcb88dc68.tar.gz
luajit-c0efa6f00ed757bc05d3a0874f98c91fcb88dc68.tar.bz2
luajit-c0efa6f00ed757bc05d3a0874f98c91fcb88dc68.zip
Replace divisions with simpler code.
Diffstat (limited to '')
-rw-r--r--src/lj_bcwrite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_bcwrite.c b/src/lj_bcwrite.c
index 27f08fe8..5050da07 100644
--- a/src/lj_bcwrite.c
+++ b/src/lj_bcwrite.c
@@ -324,7 +324,7 @@ static void bcwrite_proto(BCWriteCtx *ctx, GCproto *pt)
324 /* Pass buffer to writer function. */ 324 /* Pass buffer to writer function. */
325 if (ctx->status == 0) { 325 if (ctx->status == 0) {
326 MSize n = ctx->sb.n - 5; 326 MSize n = ctx->sb.n - 5;
327 MSize nn = 1 + lj_fls(n)/7; 327 MSize nn = (lj_fls(n)+8)*9 >> 6;
328 ctx->sb.n = 5 - nn; 328 ctx->sb.n = 5 - nn;
329 bcwrite_uleb128(ctx, n); /* Fill in final size. */ 329 bcwrite_uleb128(ctx, n); /* Fill in final size. */
330 lua_assert(ctx->sb.n == 5); 330 lua_assert(ctx->sb.n == 5);