Add support for channelsToTreat
to be empty
It's the case when providing a single channel in `channels.txt` for instance.
This commit is contained in:
parent
95e96d08e1
commit
02c3d74eb6
2
main.cpp
2
main.cpp
@ -712,7 +712,7 @@ void markChannelAsRequiringTreatmentIfNeeded(unsigned short threadId, string cha
|
|||||||
if(channelsAlreadyTreated.find(channelId) == channelsAlreadyTreated.end() && channelsToTreatRev.find(channelId) == channelsToTreatRev.end())
|
if(channelsAlreadyTreated.find(channelId) == channelsAlreadyTreated.end() && channelsToTreatRev.find(channelId) == channelsToTreatRev.end())
|
||||||
{
|
{
|
||||||
// It is unclear to me why `channelsToTreat.end()->first + 1` doesn't work here.
|
// It is unclear to me why `channelsToTreat.end()->first + 1` doesn't work here.
|
||||||
unsigned int channelsToTreatIndex = channelsToTreat.rbegin()->first + 1;
|
unsigned int channelsToTreatIndex = !channelsToTreat.empty() ? channelsToTreat.rbegin()->first + 1 : channelsAlreadyTreated.size();
|
||||||
channelsToTreat[channelsToTreatIndex] = channelId;
|
channelsToTreat[channelsToTreatIndex] = channelId;
|
||||||
channelsToTreatRev[channelId] = channelsToTreatIndex;
|
channelsToTreatRev[channelId] = channelsToTreatIndex;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user