cleanup: Remove rak/functional.h

This commit replaces the `rak/functional.h` features with lambdas and std functions.

There was one instance with `std::sort` where the comparison operator was always evaluating to false and it wasn't sorting anything. This is removed in favour of the default comparison operator.

`std::sort(transferChunks.begin(), transferChunks.end());`
This commit is contained in:
stickz
2025-01-12 14:16:20 -05:00
parent 2b73c92a3e
commit 712e7e5db0
16 changed files with 21 additions and 536 deletions
+2 -3
View File
@@ -37,7 +37,6 @@
#include "config.h"
#include <algorithm>
#include <rak/functional.h>
#include <torrent/exceptions.h>
#include <torrent/object.h>
@@ -76,12 +75,12 @@ ViewManager::insert(const std::string& name) {
ViewManager::iterator
ViewManager::find(const std::string& name) {
return std::find_if(begin(), end(), rak::equal(name, std::mem_fun(&View::name)));
return std::find_if(begin(), end(), [name](View* v){ return name == v->name(); });
}
ViewManager::iterator
ViewManager::find_throw(const std::string& name) {
iterator itr = std::find_if(begin(), end(), rak::equal(name, std::mem_fun(&View::name)));
iterator itr = std::find_if(begin(), end(), [name](View* v){ return name == v->name(); });
if (itr == end())
throw torrent::input_error("Could not find view: " + name);