{
    "Function": "_buildSortIndices",
    "File": "contracts/test/BalancerRegistry.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "Math"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "min"
    ],
    "Low-Level Calls": [],
    "Code": "function _buildSortIndices(uint256[] memory effectiveLiquidity)\n        internal pure returns(bytes32)\n    {\n        uint256 result = 0;\n        uint256 prevEffectiveLiquidity = uint256(-1);\n        for (uint i = 0; i < Math.min(effectiveLiquidity.length, 32); i++) {\n            uint256 bestIndex = 0;\n            for (uint j = 0; j < effectiveLiquidity.length; j++) {\n                if ((effectiveLiquidity[j] > effectiveLiquidity[bestIndex] && effectiveLiquidity[j] < prevEffectiveLiquidity) || effectiveLiquidity[bestIndex] >= prevEffectiveLiquidity) {\n                    bestIndex = j;\n                }\n            }\n            prevEffectiveLiquidity = effectiveLiquidity[bestIndex];\n            result |= (bestIndex + 1) << (248 - i * 8);\n        }\n        return bytes32(result);\n    }"
}