3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

Use const refs to reduce copying.

These are things that have been found by `clang-tidy`.
This commit is contained in:
Bruce Mitchener 2018-01-30 21:43:56 +07:00
parent 5a16d3ef7f
commit 177414c0ee
28 changed files with 62 additions and 62 deletions

View file

@ -547,7 +547,7 @@ namespace datalog {
//
// -----------------------------------
void get_file_names(std::string directory, std::string extension, bool traverse_subdirs,
void get_file_names(std::string directory, const std::string & extension, bool traverse_subdirs,
string_vector & res) {
if(directory[directory.size()-1]!='\\' && directory[directory.size()-1]!='/') {
@ -595,7 +595,7 @@ namespace datalog {
#endif
}
bool file_exists(std::string name) {
bool file_exists(const std::string & name) {
struct stat st;
if(stat(name.c_str(),&st) == 0) {
return true;
@ -603,7 +603,7 @@ namespace datalog {
return false;
}
bool is_directory(std::string name) {
bool is_directory(const std::string & name) {
if(!file_exists(name)) {
return false;
}
@ -612,7 +612,7 @@ namespace datalog {
return (status.st_mode&S_IFDIR)!=0;
}
std::string get_file_name_without_extension(std::string name) {
std::string get_file_name_without_extension(const std::string & name) {
size_t slash_index = name.find_last_of("\\/");
size_t dot_index = name.rfind(".");
size_t ofs = (slash_index==std::string::npos) ? 0 : slash_index+1;