Fix race condition on m_tag_to_queue_map

This commit is contained in:
2026-03-02 00:52:27 -05:00
parent 9a0d2c2f99
commit 737cfd2196
3 changed files with 13 additions and 12 deletions

View File

@@ -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