Skip to content

Commit

Permalink
Use listLast to replace listIndex -1
Browse files Browse the repository at this point in the history
Minor cleanup, listLast do the same thing and is widely used
and easier to understand (less code).

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Oct 14, 2024
1 parent 0142198 commit ec36f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aof.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ec36f28

Please sign in to comment.