Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Lua] Renamed host 'power' to 'speed' for hosts
[simgrid.git] / examples / lua / kademlia / routing_table.lua
index 3c2b636..089cc89 100644 (file)
@@ -1,3 +1,9 @@
+-- Copyright (c) 2012, 2014. The SimGrid Team.
+-- All rights reserved.
+
+-- This program is free software; you can redistribute it and/or modify it
+-- under the terms of the license (GNU LGPL) which comes with this package.
+
 -- Routing table data
 routing_table = {
 buckets = {},
@@ -46,7 +52,7 @@ function routing_table_update(id)
                simgrid.debug("Updating " .. id .. " in my routing table")
                -- If the element is already in the bucket, we update it.
                table.remove(bucket.list,index_of(bucket.list,id))
-               table.insert(bucket.list,0,id)
+               table.insert(bucket.list,id)
        else    
                simgrid.debug("Insert " .. id .. " in my routing table in bucket " .. bucket.id)
                table.insert(bucket.list,id)
@@ -89,4 +95,4 @@ function find_closest(destination_id)
        end
        
        return answer
-end
\ No newline at end of file
+end