diff --git a/headers/os/storage/Node.h b/headers/os/storage/Node.h index 7643a61597..618d4aec0a 100644 --- a/headers/os/storage/Node.h +++ b/headers/os/storage/Node.h @@ -22,6 +22,7 @@ struct node_ref { bool operator==(const node_ref& ref) const; bool operator!=(const node_ref& ref) const; + bool operator<(const node_ref& ref) const; node_ref& operator=(const node_ref& ref); dev_t device; diff --git a/src/kits/storage/Node.cpp b/src/kits/storage/Node.cpp index 5cce99b1a7..83ce9dc59d 100644 --- a/src/kits/storage/Node.cpp +++ b/src/kits/storage/Node.cpp @@ -68,6 +68,16 @@ node_ref::operator!=(const node_ref &ref) const return !(*this == ref); } + +bool +node_ref::operator<(const node_ref& other) const +{ + if (this->device != other.device) + return this->device < other.device; + return this->node < other.node; +} + + // = node_ref& node_ref::operator=(const node_ref &ref) diff --git a/src/kits/tracker/VirtualDirectoryManager.cpp b/src/kits/tracker/VirtualDirectoryManager.cpp index 40dce3fdb9..e385efde63 100644 --- a/src/kits/tracker/VirtualDirectoryManager.cpp +++ b/src/kits/tracker/VirtualDirectoryManager.cpp @@ -35,15 +35,6 @@ static const char* const kTemporaryDefinitionFileBaseDirectoryPath = "/tmp/tracker/virtual-directories"; -static bool -operator<(const node_ref& a, const node_ref& b) -{ - if (a.device != b.device) - return a.device < b.device; - return a.node < b.node; -} - - // #pragma mark - Info