mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-24 01:42:22 +08:00
优化解析复杂数据结构配置项时的性能
This commit is contained in:
@@ -45,10 +45,12 @@ static uint32_t addressToInt(const string &ip){
|
||||
|
||||
std::shared_ptr<uint32_t> MultiCastAddressMaker::obtain(uint32_t max_try) {
|
||||
lock_guard<recursive_mutex> lck(_mtx);
|
||||
GET_CONFIG(string, addrMinStr, MultiCast::kAddrMin);
|
||||
GET_CONFIG(string, addrMaxStr, MultiCast::kAddrMax);
|
||||
uint32_t addrMin = addressToInt(addrMinStr);
|
||||
uint32_t addrMax = addressToInt(addrMaxStr);
|
||||
GET_CONFIG_FUNC(uint32_t, addrMin, MultiCast::kAddrMin, [](const string &str) {
|
||||
return addressToInt(str);
|
||||
});
|
||||
GET_CONFIG_FUNC(uint32_t, addrMax, MultiCast::kAddrMax, [](const string &str) {
|
||||
return addressToInt(str);
|
||||
});
|
||||
|
||||
if (_addr > addrMax || _addr == 0) {
|
||||
_addr = addrMin;
|
||||
|
||||
Reference in New Issue
Block a user