Merge "Inlining set_partition_seg_context function."