Software /
code /
prosody
Comparison
net/websocket/frames.lua @ 9659:86c431650dfd
net.websocket.frames: Prefer Lua 5.2 built-in bit module over LuaJIT version
When running on Lua 5.2 this makes sense since bit32 is usually already
loaded. It's sensible to prefer this going forward in case of
incompatibilities between the two variants.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 29 Nov 2018 16:53:22 +0100 |
parent | 8728:41c959c5c84b |
child | 9691:e11e076f0eb8 |
comparison
equal
deleted
inserted
replaced
9658:597653fe8ea4 | 9659:86c431650dfd |
---|---|
7 -- | 7 -- |
8 | 8 |
9 local softreq = require "util.dependencies".softreq; | 9 local softreq = require "util.dependencies".softreq; |
10 local random_bytes = require "util.random".bytes; | 10 local random_bytes = require "util.random".bytes; |
11 | 11 |
12 local bit = assert(softreq"bit" or softreq"bit32", | 12 local bit = assert(softreq"bit32" or softreq"bit", |
13 "No bit module found. See https://prosody.im/doc/depends#bitop"); | 13 "No bit module found. See https://prosody.im/doc/depends#bitop"); |
14 local band = bit.band; | 14 local band = bit.band; |
15 local bor = bit.bor; | 15 local bor = bit.bor; |
16 local bxor = bit.bxor; | 16 local bxor = bit.bxor; |
17 local lshift = bit.lshift; | 17 local lshift = bit.lshift; |