This commit is contained in:
2025-09-15 07:00:21 +02:00
parent 9fdb74b5fb
commit 95e7020c00

View File

@@ -1,14 +1,14 @@
module herofs module herofs
// Check if a blob is used by other files (excluding the specified file_id) // // Check if a blob is used by other files (excluding the specified file_id)
fn (mut self FsTools) is_blob_used_by_other_files(blob_id u32, exclude_file_id u32) !bool { // fn (mut self FsTools) is_blob_used_by_other_files(blob_id u32, exclude_file_id u32) !bool {
// This is a simple but potentially expensive check // // This is a simple but potentially expensive check
// In a production system, you might want to maintain reverse indices // // In a production system, you might want to maintain reverse indices
all_files := self.list_all_files()! // all_files := self.list_all_files()!
for file in all_files { // for file in all_files {
if file.id != exclude_file_id && blob_id in file.blobs { // if file.id != exclude_file_id && blob_id in file.blobs {
return true // return true
} // }
} // }
return false // return false
} // }