Changeset

6340:7e820979fd9b

util.jid: Optimize bare
author Kim Alvefur <zash@zash.se>
date Thu, 07 Aug 2014 17:43:28 +0200
parents 6339:1c19464cde77
children 6341:ab9a1af80632
files util/jid.lua
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/util/jid.lua	Thu Aug 07 17:35:11 2014 +0200
+++ b/util/jid.lua	Thu Aug 07 17:43:28 2014 +0200
@@ -37,11 +37,7 @@
 split = _split;
 
 function bare(jid)
-	local node, host = _split(jid);
-	if node and host then
-		return node.."@"..host;
-	end
-	return host;
+	return jid and match(jid, "^[^/]+");
 end
 
 local function _prepped_split(jid)