# HG changeset patch # User daurnimator # Date 1421694071 18000 # Node ID a702786f4f311d02e6a192bf019e365036cc2482 # Parent 31a8b3bfb31d6145c3a8a2b789d2d3f92eed0dc9 net.server_select: Remove do-nothing os_difftime calls diff -r 31a8b3bfb31d -r a702786f4f31 net/server_select.lua --- a/net/server_select.lua Thu Jan 15 09:05:08 2015 -0500 +++ b/net/server_select.lua Mon Jan 19 14:01:11 2015 -0500 @@ -38,7 +38,6 @@ --// lua lib methods //-- -local os_difftime = os.difftime local math_min = math.min local math_huge = math.huge local table_concat = table.concat @@ -923,17 +922,16 @@ _currenttime = luasocket_gettime( ) -- Check for socket timeouts - local difftime = os_difftime( _currenttime - _starttime ) - if difftime > _checkinterval then + if _currenttime - _starttime > _checkinterval then _starttime = _currenttime for handler, timestamp in pairs( _writetimes ) do - if os_difftime( _currenttime - timestamp ) > _sendtimeout then + if _currenttime - timestamp > _sendtimeout then handler.disconnect( )( handler, "send timeout" ) handler:force_close() -- forced disconnect end end for handler, timestamp in pairs( _readtimes ) do - if os_difftime( _currenttime - timestamp ) > _readtimeout then + if _currenttime - timestamp > _readtimeout then if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then handler.disconnect( )( handler, "read timeout" ) handler:close( ) -- forced disconnect?