diff options
author | Kim Alvefur <zash@zash.se> | 2020-11-15 14:48:59 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-11-15 14:48:59 +0100 |
commit | b45a4a42475c0ccdc341be023d95206716fd22b9 (patch) | |
tree | 6b3a1ea952a471dbc2ac568ba4a39c95ffb99992 | |
parent | 8ae67fb1fd4ed21346a7afd8767dd634344b39ee (diff) | |
download | prosody-b45a4a42475c0ccdc341be023d95206716fd22b9.tar.gz prosody-b45a4a42475c0ccdc341be023d95206716fd22b9.zip |
util.hashring: Normalize indentation to tabs
-rw-r--r-- | util/hashring.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/util/hashring.lua b/util/hashring.lua index 322bc005..d4555669 100644 --- a/util/hashring.lua +++ b/util/hashring.lua @@ -1,13 +1,13 @@ local function generate_ring(nodes, num_replicas, hash) local new_ring = {}; - for _, node_name in ipairs(nodes) do - for replica = 1, num_replicas do - local replica_hash = hash(node_name..":"..replica); - new_ring[replica_hash] = node_name; - table.insert(new_ring, replica_hash); - end - end - table.sort(new_ring); + for _, node_name in ipairs(nodes) do + for replica = 1, num_replicas do + local replica_hash = hash(node_name..":"..replica); + new_ring[replica_hash] = node_name; + table.insert(new_ring, replica_hash); + end + end + table.sort(new_ring); return new_ring; end |