Xuanwo commented on code in PR #3652:
URL: 
https://github.com/apache/incubator-opendal/pull/3652#discussion_r1402222479


##########
core/src/services/azfile/core.rs:
##########
@@ -420,6 +420,21 @@ impl AzfileCore {
             p = get_parent(p);
             dirs.push_front(p);
         }
+
+        let mut pop_dir_count = dirs.len() as u8;
+        for dir in dirs.iter().rev() {
+            let resp = self.azfile_get_path_properties(dir).await?;
+            if resp.status() == StatusCode::NOT_FOUND {
+                pop_dir_count -= 1;
+                continue;
+            }
+            break;
+        }
+
+        for _ in 0..pop_dir_count {
+            dirs.pop_front();
+        }
+

Review Comment:
   We can use dirs.iter().skip() to avoid calling `pop_front()` in a for loop.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to