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:
Binbin 2024-10-15 10:29:52 +08:00 committed by GitHub
parent 9c20c84251
commit 87b5e13465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -476,7 +476,7 @@ sds getLastIncrAofName(aofManifest *am) {
}
/* Or return the last one. */
listNode *lastnode = listIndex(am->incr_aof_list, -1);
listNode *lastnode = listLast(am->incr_aof_list);
aofInfo *ai = listNodeValue(lastnode);
return ai->file_name;
}