我有一个按值排序的数组active
,如下所示:
patient = Array {
[0] = Array {
active = Y
priority = o
},
[1] = Array {
active = Y
priority = P
},
[2] = Array {
active = Y
priority = S
},
[3] = Array {
active = Y
priority = T
},
[4] = Array {
active = N
priority = S
}
}
我想采用具有priority=的元素o
并在最后追加而不用活动元素更改排序。输出应该是这样的:
patient = Array {
[1] = Array {
active = Y
priority = P
},
[2] = Array {
active = Y
priority = S
},
[3] = Array {
active = Y
priority = T
},
[0] = Array {
active = Y
priority = o
},
[4] = Array {
active = N
priority = S
}
}
键的顺序无关紧要。