Skip to content

Commit

Permalink
[SYS-5571] Stop constructing string to check isManifest
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaJie Ye committed Jul 10, 2023
1 parent bded6cd commit e52a902
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cloud/filename.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <functional>
#include <string>
#include <cstring>
#include <folly/Range.h>

//
// These are inlined methods to deal with pathnames and filenames.
Expand Down Expand Up @@ -150,10 +151,10 @@ inline bool IsWalFile(const std::string& pathname) {

inline bool IsManifestFile(const std::string& pathname) {
// extract last component of the path
std::string fname;
folly::StringPiece fname;
size_t offset = pathname.find_last_of(pathsep);
if (offset != std::string::npos) {
fname = pathname.substr(offset + 1, pathname.size());
fname = folly::StringPiece(&pathname[offset + 1], pathname.end().base());
} else {
fname = pathname;
}
Expand Down

0 comments on commit e52a902

Please sign in to comment.