08-15-2022 09:09 AM
Hello @All,
Are several conditions checked equally one after the other or do the conditions have to be nested by use of " else "?
So variant 1 or 2?
Variant 1
if (recv-listener == "in") {
if (sendergroup == "TRUSTLIST") {
action;
}
if (sendergroup == "GOODSENDERSLIST") {
action;
}
if (sendergroup == "LOWERREPUTAIONLIST") {
action;
}
}
Variant 2
if (recv-listener == "in") {
if (sendergroup == "TRUSTLIST") {
action;
} else {
if (sendergroup == "GOODSENDERSLIST") {
action;
} else {
if (sendergroup == "LOWERREPUTAIONLIST") {
action;
}
}
}
}
If both variants work, are there any differences in performance?
Regards Stefan
Solved! Go to Solution.
08-15-2022 09:46 AM
08-15-2022 09:46 AM
08-15-2022 11:36 AM
Hi Ken,
thank you much for your answer.
That's a pretty good hint that the condition that applies most often should be at the top.
Best Regards
Stefan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide