sync refactor
This commit is contained in:
parent
d958655dd3
commit
3fb4b86248
|
@ -86,7 +86,7 @@ cJSON *voteGranted2Json(SVotesGranted *pVotesGranted) {
|
||||||
cJSON *pReplicas = cJSON_CreateArray();
|
cJSON *pReplicas = cJSON_CreateArray();
|
||||||
cJSON_AddItemToObject(pRoot, "replicas", pReplicas);
|
cJSON_AddItemToObject(pRoot, "replicas", pReplicas);
|
||||||
for (int i = 0; i < pVotesGranted->replicaNum; ++i) {
|
for (int i = 0; i < pVotesGranted->replicaNum; ++i) {
|
||||||
cJSON_AddItemToArray(pReplicas, syncUtilRaftId2Json(&(*(pVotesGranted->replicas)[i])));
|
cJSON_AddItemToArray(pReplicas, syncUtilRaftId2Json(&(*(pVotesGranted->replicas))[i]));
|
||||||
}
|
}
|
||||||
int *arr = (int *)malloc(sizeof(int) * pVotesGranted->replicaNum);
|
int *arr = (int *)malloc(sizeof(int) * pVotesGranted->replicaNum);
|
||||||
for (int i = 0; i < pVotesGranted->replicaNum; ++i) {
|
for (int i = 0; i < pVotesGranted->replicaNum; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue