Trim down redbean a little bit

This makes redbean.c a little less long. It also reduces the size of
redbean-original.com from being 333K to 213K.
This commit is contained in:
Justine Tunney 2022-03-21 19:31:03 -07:00
parent 87029ac3f9
commit 5022f9e920
21 changed files with 999 additions and 669 deletions

View file

@ -12983,8 +12983,12 @@ static JSValue js_create_function(JSContext *ctx, JSFunctionDef *fd)
}
} else {
b->vardefs = (void *)((uint8_t*)b + vardefs_offset);
memcpy(b->vardefs, fd->args, fd->arg_count * sizeof(fd->args[0]));
memcpy(b->vardefs + fd->arg_count, fd->vars, fd->var_count * sizeof(fd->vars[0]));
if (fd->arg_count) {
memcpy(b->vardefs, fd->args, fd->arg_count * sizeof(fd->args[0]));
}
if (fd->var_count) {
memcpy(b->vardefs + fd->arg_count, fd->vars, fd->var_count * sizeof(fd->vars[0]));
}
}
b->var_count = fd->var_count;
b->arg_count = fd->arg_count;