Use td::Hash instead of std::hash.

This commit is contained in:
levlam 2022-11-23 23:43:05 +03:00
parent 428f438e4f
commit a016d13c15
3 changed files with 7 additions and 9 deletions

View File

@ -22,13 +22,13 @@
#include "td/utils/Container.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/FlatHashSet.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/JsonBuilder.h"
#include "td/utils/Promise.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include "td/utils/WaitFreeHashMap.h"
#include <functional>
#include <limits>
#include <memory>
#include <queue>
@ -836,9 +836,9 @@ class Client final : public WebhookActor::Callback {
};
struct FullMessageIdHash {
std::size_t operator()(FullMessageId full_message_id) const {
return std::hash<td::int64>()(full_message_id.chat_id) * 2023654985u +
std::hash<td::int64>()(full_message_id.message_id);
td::uint32 operator()(FullMessageId full_message_id) const {
return td::Hash<td::int64>()(full_message_id.chat_id) * 2023654985u +
td::Hash<td::int64>()(full_message_id.message_id);
}
};

View File

@ -31,8 +31,6 @@
#include "td/utils/Span.h"
#include "td/utils/Time.h"
#include <limits>
namespace telegram_bot_api {
static int VERBOSITY_NAME(webhook) = VERBOSITY_NAME(DEBUG);

View File

@ -22,6 +22,7 @@
#include "td/utils/Container.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/FloodControlFast.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/HttpUrl.h"
#include "td/utils/JsonBuilder.h"
#include "td/utils/List.h"
@ -32,7 +33,6 @@
#include "td/utils/VectorQueue.h"
#include <atomic>
#include <functional>
#include <memory>
#include <set>
#include <tuple>
@ -123,8 +123,8 @@ class WebhookActor final : public td::HttpOutboundConnection::Callback {
td::TQueue::EventId tqueue_offset_;
std::size_t max_loaded_updates_ = 0;
struct EventIdHash {
std::size_t operator()(td::TQueue::EventId event_id) const {
return std::hash<td::int32>()(event_id.value());
td::uint32 operator()(td::TQueue::EventId event_id) const {
return td::Hash<td::int32>()(event_id.value());
}
};
td::FlatHashMap<td::TQueue::EventId, td::unique_ptr<Update>, EventIdHash> update_map_;