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
main
yaphet 2 years ago committed by Facebook GitHub Bot
parent 37ec9d0c12
commit 7fb723f581
  1. 2
      tools/ldb_cmd.cc
  2. 2
      tools/ldb_cmd_test.cc

@ -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;

@ -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("/");
}

Loading…
Cancel
Save