Skip to content

Commit

Permalink
passing string by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammedzakikochargi committed Jul 27, 2023
1 parent aad7929 commit b590fc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions base/include/OrderedCacheOfFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class OrderedCacheOfFiles
std::string getFileAt(uint64_t timestamp, bool direction);
bool isTimeStampInFile(std::string& filename, uint64_t timestamp);
std::string getNextFileAfter(std::string& currentFile, bool direction);
std::vector<boost::filesystem::path> parseAndSortDateDir(std::string rootDir);
std::vector<boost::filesystem::path> parseAndSortHourDir(std::string rootDir);
std::vector<boost::filesystem::path> parseAndSortMp4Files(std::string rootDir);
std::vector<boost::filesystem::path> parseAndSortDateDir(std::string& rootDir);
std::vector<boost::filesystem::path> parseAndSortHourDir(std::string& rootDir);
std::vector<boost::filesystem::path> parseAndSortMp4Files(std::string& rootDir);
bool parseFiles(uint64_t start_ts, bool direction, bool includeFloorFile = false, bool disableBatchSizeCheck = false, uint64_t skipTS = 0);
bool getRandomSeekFile(uint64_t ts, bool direction, uint64_t& skipMsecs, std::string& fileName);
bool getFileFromCache(uint64_t timestamp, bool direction, std::string& fileName);
Expand Down
6 changes: 3 additions & 3 deletions base/src/OrderedCacheOfFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ void OrderedCacheOfFiles::insertInVideoCache(Video vid)
7. If the higher watermark is breached in the videoCache, trigger a cleanup in seperate thread ?
*/

std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortDateDir(std::string rootDir)
std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortDateDir(std::string& rootDir)
{
std::vector<boost::filesystem::path> dateDir;
fs::directory_iterator dateDirIter(rootDir), dateDirEndIter;
Expand Down Expand Up @@ -588,7 +588,7 @@ std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortDateDir(st
return dateDir;
}

std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortHourDir(std::string dateDirPath)
std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortHourDir(std::string& dateDirPath)
{
std::vector<boost::filesystem::path> hourDir;

Expand All @@ -612,7 +612,7 @@ std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortHourDir(st
return hourDir;
}

std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortMp4Files(std::string hourDirPath)
std::vector<boost::filesystem::path> OrderedCacheOfFiles::parseAndSortMp4Files(std::string& hourDirPath)
{
std::vector<boost::filesystem::path> mp4Files;
fs::directory_iterator mp4FileIter(hourDirPath), mp4FileEndIter;
Expand Down

0 comments on commit b590fc8

Please sign in to comment.