[baobab] Remove unnecessary check
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Remove unnecessary check
- Date: Sun, 7 Jun 2020 15:52:54 +0000 (UTC)
commit d3809774df63c9ae214dfbdc39ec7fc56a2767df
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sun Jun 7 17:50:44 2020 +0200
Remove unnecessary check
If the attribute is not available, the method will return 0.
src/baobab-scanner.vala | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index 63445fd..7b9b41b 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -183,9 +183,7 @@ namespace Baobab {
results.time_modified = info.get_attribute_uint64 (FileAttribute.TIME_MODIFIED);
results.size = info.get_size ();
- if (info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
- results.alloc_size = info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
- }
+ results.alloc_size = info.get_attribute_uint64 (FileAttribute.STANDARD_ALLOCATED_SIZE);
results.elements = 1;
results.error = null;
results.child_error = false;
@@ -231,9 +229,7 @@ namespace Baobab {
}
results.size += child_info.get_size ();
- if (child_info.has_attribute (FileAttribute.STANDARD_ALLOCATED_SIZE)) {
- results.alloc_size += child_info.get_attribute_uint64
(FileAttribute.STANDARD_ALLOCATED_SIZE);
- }
+ results.alloc_size += child_info.get_attribute_uint64
(FileAttribute.STANDARD_ALLOCATED_SIZE);
results.elements++;
var child_time = child_info.get_attribute_uint64 (FileAttribute.TIME_MODIFIED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]