Software /
code /
prosody
Changeset
5018:eb8211b65e96
net.server_event: Replace usage of string.len() with # operator
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 26 Jul 2012 16:46:18 +0100 |
parents | 5017:a6bae9d72c8f |
children | 5019:017e864b459d |
files | net/server_event.lua |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server_event.lua Thu Jul 26 15:16:52 2012 +0100 +++ b/net/server_event.lua Thu Jul 26 16:46:18 2012 +0100 @@ -115,7 +115,6 @@ local addevent = base.addevent local coroutine_wrap, coroutine_yield = coroutine.wrap,coroutine.yield - local string_len = string.len -- Private methods function interface_mt:_position(new_position) @@ -310,7 +309,7 @@ if self.nowriting then return nil, "locked" end --vdebug( "try to send data to client, id/data:", self.id, data ) data = tostring( data ) - local len = string_len( data ) + local len = #data local total = len + self.writebufferlen if total > cfg.MAX_SEND_LENGTH then -- check buffer length local err = "send buffer exceeded"