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 | e367756529fa1add51e8d45e1dbb79f37c5965e1 (patch) | |
tree | 6b3a1ea952a471dbc2ac568ba4a39c95ffb99992 /util/hashring.lua | |
parent | 8d66f94b9ef9b0f7f667cb436615f311e6e2eca0 (diff) | |
download | prosody-e367756529fa1add51e8d45e1dbb79f37c5965e1.tar.gz prosody-e367756529fa1add51e8d45e1dbb79f37c5965e1.zip |
util.hashring: Normalize indentation to tabs
Diffstat (limited to 'util/hashring.lua')
-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 |