From 49fccb11b2adfc764637f0e5e38ee216cb37ba7c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 6 Oct 2015 16:06:22 +0200 Subject: net.websocket.frames: Simplify import of bitlib --- net/websocket/frames.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/websocket') diff --git a/net/websocket/frames.lua b/net/websocket/frames.lua index fa0e130d..23f18437 100644 --- a/net/websocket/frames.lua +++ b/net/websocket/frames.lua @@ -10,9 +10,7 @@ local softreq = require "util.dependencies".softreq; 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; -- cgit v1.2.3