Use Iterator::all in two places
This commit is contained in:
+1
-6
@@ -169,12 +169,7 @@ unsafe impl<T> BlockTrait for BlockList<T> {
|
||||
|
||||
impl<T> BlockList<T> {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
for ptr in self.ptrs.iter() {
|
||||
if !ptr.is_null() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
self.ptrs.iter().all(|ptr| ptr.is_null())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-6
@@ -68,12 +68,7 @@ unsafe impl BlockTrait for DirList {
|
||||
|
||||
impl DirList {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
for entry in self.entries.iter() {
|
||||
if !entry.node_ptr().is_null() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
self.entries.iter().all(|entry| entry.node_ptr().is_null())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user