Use listLast to replace listIndex -1 (#1163)
Minor cleanup, listLast do the same thing and is widely used and easier to understand (less code). Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
9c20c84251
commit
87b5e13465
@ -476,7 +476,7 @@ sds getLastIncrAofName(aofManifest *am) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Or return the last one. */
|
/* Or return the last one. */
|
||||||
listNode *lastnode = listIndex(am->incr_aof_list, -1);
|
listNode *lastnode = listLast(am->incr_aof_list);
|
||||||
aofInfo *ai = listNodeValue(lastnode);
|
aofInfo *ai = listNodeValue(lastnode);
|
||||||
return ai->file_name;
|
return ai->file_name;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user