net.websocket.frames: Simplify import of bitlib
authorKim Alvefur <zash@zash.se>
Tue, 06 Oct 2015 16:06:22 +0200
changeset 6898 f04fadabd5d9
parent 6897 f7203c7cb7ff
child 6899 c11776f85552
net.websocket.frames: Simplify import of bitlib
net/websocket/frames.lua
--- a/net/websocket/frames.lua	Tue Oct 06 15:30:25 2015 +0200
+++ b/net/websocket/frames.lua	Tue Oct 06 16:06:22 2015 +0200
@@ -10,9 +10,7 @@
 local log = require "util.logger".init "websocket.frames";
 local random_bytes = require "util.random".bytes;
 
-local bit;
-pcall(function() bit = require"bit"; end);
-bit = bit or softreq"bit32"
+local bit = softreq"bit" or softreq"bit32";
 if not bit then log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end
 local band = bit.band;
 local bor = bit.bor;