Using back to get the last element (#9415)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/9415

Reviewed By: ajkr

Differential Revision: D33773673

Pulled By: riversand963

fbshipit-source-id: 52b59ec5a6b01a91d3f990b7f2b0f16320afb49b
This commit is contained in:
yaphet 2022-01-27 11:34:20 -08:00 committed by Facebook GitHub Bot
parent 37ec9d0c12
commit 7fb723f581
2 changed files with 2 additions and 2 deletions

View File

@ -1191,7 +1191,7 @@ void ManifestDumpCommand::DoCommand() {
exec_state_ = LDBCommandExecuteResult::Failed(err_msg);
return;
}
if (db_path_[db_path_.length() - 1] != '/') {
if (db_path_.back() != '/') {
db_path_.append("/");
}
manifestfile = db_path_ + matched_file;

View File

@ -187,7 +187,7 @@ class FileChecksumTestHelper {
Status VerifyChecksumInManifest(
const std::vector<LiveFileMetaData>& live_files) {
// Step 1: verify if the dbname_ is correct
if (dbname_[dbname_.length() - 1] != '/') {
if (dbname_.back() != '/') {
dbname_.append("/");
}