)]}'
{"swift/common/ring/utils.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"5b014703e3c649ec2140cf7e6fe91c8f2dd9f884","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        if not devs:"},{"line_number":319,"context_line":"            return None"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        partition_count \u003d {}"},{"line_number":322,"context_line":"        for _replica_id, replica in enumerate(builder._replica2part2dev):"},{"line_number":323,"context_line":"            for partition, device in enumerate(replica):"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_f6ff9f33","line":320,"updated":"2014-09-17 06:33:02.000000000","message":"To see the old behavior insert this code here, which is basically the same as before the refactoring:\n\n        from array import array\n        from math import ceil\n        max_replicas \u003d int(ceil(builder.replicas))\n        matches \u003d [array(\u0027i\u0027) for x in xrange(max_replicas)]\n        for part in xrange(builder.parts):\n            count \u003d len([d for d in builder.get_part_devices(part)\n                         if d[\u0027id\u0027] in devs])\n            if count:\n                matches[max_replicas - count].append(part)\n\n        sorted_partition_count \u003d []\n        for index, parts in enumerate(matches):\n            for part in parts:\n                sorted_partition_count.append((part, max_replicas - index))\n\n        return sorted_partition_count\n\nTests should fail then.","commit_id":"81ca5b2c1ed29b2f3496facdbf13ac42f8f3fda7"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"df780cdcbc0f9f40288f1acaf955ba30877b4223","unresolved":false,"context_lines":[{"line_number":319,"context_line":"            return None"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        partition_count \u003d {}"},{"line_number":322,"context_line":"        for _replica_id, replica in enumerate(builder._replica2part2dev):"},{"line_number":323,"context_line":"            for partition, device in enumerate(replica):"},{"line_number":324,"context_line":"                if device in devs:"},{"line_number":325,"context_line":"                    if partition not in partition_count:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_49b9b42d","line":322,"updated":"2014-09-29 19:21:34.000000000","message":"If _replica_id is unused, is there any reason to enumerate() here?","commit_id":"81ca5b2c1ed29b2f3496facdbf13ac42f8f3fda7"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"62038e44075d806c93a425a21bc68e9f5bf4d192","unresolved":false,"context_lines":[{"line_number":319,"context_line":"            return None"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        partition_count \u003d {}"},{"line_number":322,"context_line":"        for _replica_id, replica in enumerate(builder._replica2part2dev):"},{"line_number":323,"context_line":"            for partition, device in enumerate(replica):"},{"line_number":324,"context_line":"                if device in devs:"},{"line_number":325,"context_line":"                    if partition not in partition_count:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_0977acd5","line":322,"in_reply_to":"baa201ad_49b9b42d","updated":"2014-09-29 19:40:18.000000000","message":"Good catch, there is no reason for this - I removed the enumerate. Thanks!","commit_id":"81ca5b2c1ed29b2f3496facdbf13ac42f8f3fda7"}]}
