mirror of
https://github.com/BotChain-Robots/rpc.git
synced 2026-03-09 23:12:27 +01:00
Fix race condition on m_tag_to_queue_map
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cctype>
|
||||
#include <algorithm>
|
||||
|
||||
inline std::vector<std::string> split(const std::string &str, const char delimiter) {
|
||||
std::vector<std::string> result;
|
||||
@@ -22,15 +22,15 @@ inline std::vector<std::string> split(const std::string &str, const char delimit
|
||||
return result;
|
||||
}
|
||||
|
||||
inline bool is_integer(const std::string& s) {
|
||||
if (s.empty()) return false;
|
||||
inline bool is_integer(const std::string &s) {
|
||||
if (s.empty())
|
||||
return false;
|
||||
|
||||
size_t start = 0;
|
||||
if (s[0] == '-' || s[0] == '+')
|
||||
start = 1;
|
||||
|
||||
return start < s.size() &&
|
||||
std::all_of(s.begin() + start, s.end(), ::isdigit);
|
||||
return start < s.size() && std::all_of(s.begin() + start, s.end(), ::isdigit);
|
||||
}
|
||||
|
||||
#endif // STRING_H
|
||||
|
||||
Reference in New Issue
Block a user