Convert some iterators to C++-11 range-based loops

This commit is contained in:
ridiculousfish
2018-09-16 15:49:18 -07:00
parent 62870abe34
commit f3da54d99c
4 changed files with 8 additions and 13 deletions

View File

@@ -203,9 +203,8 @@ bool path_get_cdpath(const env_var_t &dir_var, wcstring *out, const wchar_t *wd,
}
bool success = false;
for (wcstring_list_t::const_iterator iter = paths.begin(); iter != paths.end(); ++iter) {
for (const wcstring &dir : paths) {
struct stat buf;
const wcstring &dir = *iter;
if (wstat(dir, &buf) == 0) {
if (S_ISDIR(buf.st_mode)) {
success = true;