From 247f2fb6917ce95d6a0535a42c16d954be6ad165 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 6 Aug 2018 23:46:24 -0400 Subject: [PATCH] packagefs: Rename isNewest to overridesHead. As pointed out by Adrien. Thanks for the review! Also fixed missing dereference operators. --- .../file_systems/packagefs/nodes/UnpackingDirectory.cpp | 4 ++-- .../file_systems/packagefs/nodes/UnpackingLeafNode.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingDirectory.cpp b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingDirectory.cpp index 84cb86fced..0f322453e5 100644 --- a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingDirectory.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingDirectory.cpp @@ -108,9 +108,9 @@ UnpackingDirectory::AddPackageNode(PackageNode* packageNode, dev_t deviceID) = dynamic_cast(packageNode); PackageDirectory* other = fPackageDirectories.Head(); - bool isNewest = other == NULL || *packageDirectory > *other; + bool overridesHead = other == NULL || *packageDirectory > *other; - if (isNewest) { + if (overridesHead) { fPackageDirectories.Insert(other, packageDirectory); NodeReinitVFS(deviceID, fID, packageDirectory, other, fFlags); } else diff --git a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp index fc7a0e2627..86ddcafd27 100644 --- a/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp @@ -116,10 +116,9 @@ UnpackingLeafNode::AddPackageNode(PackageNode* packageNode, dev_t deviceID) = dynamic_cast(packageNode); PackageLeafNode* headNode = fPackageNodes.Head(); - bool isNewest = headNode == NULL - || packageLeafNode > headNode; + bool overridesHead = headNode == NULL || *packageLeafNode > *headNode; - if (isNewest) { + if (overridesHead) { fPackageNodes.Add(packageLeafNode); NodeReinitVFS(deviceID, fID, packageLeafNode, headNode, fFlags); } else {