mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-19 09:07:48 +01:00
Use td::Hash instead of std::hash.
This commit is contained in:
parent
428f438e4f
commit
a016d13c15
@ -22,13 +22,13 @@
|
|||||||
#include "td/utils/Container.h"
|
#include "td/utils/Container.h"
|
||||||
#include "td/utils/FlatHashMap.h"
|
#include "td/utils/FlatHashMap.h"
|
||||||
#include "td/utils/FlatHashSet.h"
|
#include "td/utils/FlatHashSet.h"
|
||||||
|
#include "td/utils/HashTableUtils.h"
|
||||||
#include "td/utils/JsonBuilder.h"
|
#include "td/utils/JsonBuilder.h"
|
||||||
#include "td/utils/Promise.h"
|
#include "td/utils/Promise.h"
|
||||||
#include "td/utils/Slice.h"
|
#include "td/utils/Slice.h"
|
||||||
#include "td/utils/Status.h"
|
#include "td/utils/Status.h"
|
||||||
#include "td/utils/WaitFreeHashMap.h"
|
#include "td/utils/WaitFreeHashMap.h"
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
@ -836,9 +836,9 @@ class Client final : public WebhookActor::Callback {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct FullMessageIdHash {
|
struct FullMessageIdHash {
|
||||||
std::size_t operator()(FullMessageId full_message_id) const {
|
td::uint32 operator()(FullMessageId full_message_id) const {
|
||||||
return std::hash<td::int64>()(full_message_id.chat_id) * 2023654985u +
|
return td::Hash<td::int64>()(full_message_id.chat_id) * 2023654985u +
|
||||||
std::hash<td::int64>()(full_message_id.message_id);
|
td::Hash<td::int64>()(full_message_id.message_id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
#include "td/utils/Span.h"
|
#include "td/utils/Span.h"
|
||||||
#include "td/utils/Time.h"
|
#include "td/utils/Time.h"
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
namespace telegram_bot_api {
|
namespace telegram_bot_api {
|
||||||
|
|
||||||
static int VERBOSITY_NAME(webhook) = VERBOSITY_NAME(DEBUG);
|
static int VERBOSITY_NAME(webhook) = VERBOSITY_NAME(DEBUG);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "td/utils/Container.h"
|
#include "td/utils/Container.h"
|
||||||
#include "td/utils/FlatHashMap.h"
|
#include "td/utils/FlatHashMap.h"
|
||||||
#include "td/utils/FloodControlFast.h"
|
#include "td/utils/FloodControlFast.h"
|
||||||
|
#include "td/utils/HashTableUtils.h"
|
||||||
#include "td/utils/HttpUrl.h"
|
#include "td/utils/HttpUrl.h"
|
||||||
#include "td/utils/JsonBuilder.h"
|
#include "td/utils/JsonBuilder.h"
|
||||||
#include "td/utils/List.h"
|
#include "td/utils/List.h"
|
||||||
@ -32,7 +33,6 @@
|
|||||||
#include "td/utils/VectorQueue.h"
|
#include "td/utils/VectorQueue.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <functional>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@ -123,8 +123,8 @@ class WebhookActor final : public td::HttpOutboundConnection::Callback {
|
|||||||
td::TQueue::EventId tqueue_offset_;
|
td::TQueue::EventId tqueue_offset_;
|
||||||
std::size_t max_loaded_updates_ = 0;
|
std::size_t max_loaded_updates_ = 0;
|
||||||
struct EventIdHash {
|
struct EventIdHash {
|
||||||
std::size_t operator()(td::TQueue::EventId event_id) const {
|
td::uint32 operator()(td::TQueue::EventId event_id) const {
|
||||||
return std::hash<td::int32>()(event_id.value());
|
return td::Hash<td::int32>()(event_id.value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
td::FlatHashMap<td::TQueue::EventId, td::unique_ptr<Update>, EventIdHash> update_map_;
|
td::FlatHashMap<td::TQueue::EventId, td::unique_ptr<Update>, EventIdHash> update_map_;
|
||||||
|
Loading…
Reference in New Issue
Block a user