sync refactor
This commit is contained in:
parent
d958655dd3
commit
3fb4b86248
|
@ -86,7 +86,7 @@ cJSON *voteGranted2Json(SVotesGranted *pVotesGranted) {
|
|||
cJSON *pReplicas = cJSON_CreateArray();
|
||||
cJSON_AddItemToObject(pRoot, "replicas", pReplicas);
|
||||
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);
|
||||
for (int i = 0; i < pVotesGranted->replicaNum; ++i) {
|
||||
|
@ -114,7 +114,7 @@ cJSON *voteGranted2Json(SVotesGranted *pVotesGranted) {
|
|||
|
||||
char *voteGranted2Str(SVotesGranted *pVotesGranted) {
|
||||
cJSON *pJson = voteGranted2Json(pVotesGranted);
|
||||
char *serialized = cJSON_Print(pJson);
|
||||
char * serialized = cJSON_Print(pJson);
|
||||
cJSON_Delete(pJson);
|
||||
return serialized;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue