I have this line of code:
if likely(f.req.contains(result.map((x) => x.kind)))
the result is a seq of ref object types, which I'm first mapping to their kind (@[A,B,C]) and then checking if an array of accepted types (@[ @[A,B], @[B,C], @[A,B,C]]) contains it.
However, when I'm looking at the produced code, I'm slightly confused:
// if likely(f.req.contains(result.map((x) => x.kind))):
{
tyProc__S5XwY75RQGbSnqH80Uif5g T4_;
tySequence__537me48qVSSenP6sXXDGBg* T5_;
NIM_BOOL T6_;
NIM_BOOL T7_;
// likelyProc(val)
// if likely(f.req.contains(result.map((x) => x.kind))):
// if likely(f.req.contains(result.map((x) => x.kind))):
nimZeroMem((void*)(&T4_), sizeof(tyProc__S5XwY75RQGbSnqH80Uif5g));
T4_.ClP_0 = ((TM__Z17bV9bnFJv6LB5c6u5v7yg_1092) (colonanonymous___3vPrCUS9cbhN1eRgSY9a8vSQ)); T4_.ClE_0 = NIM_NIL;
// if likely(f.req.contains(result.map((x) => x.kind))):
T5_ = (tySequence__537me48qVSSenP6sXXDGBg*)0;
T5_ = map__ikGFJl5NO4CHI8sWMpZoqQsequtils(result->data, (result ? result->Sup.len : 0), T4_);
// if likely(f.req.contains(result.map((x) => x.kind))):
T6_ = (NIM_BOOL)0;
T6_ = contains__ie6gu3XBlMoNiopZ4BBu1Asystem((*f).req->data, ((*f).req ? (*f).req->Sup.len : 0), T5_);
// likelyProc(val)
T7_ = (NIM_BOOL)0;
T7_ = NIM_LIKELY(T6_);
if (!T7_) goto LA8_;
// return
goto BeforeRet_;
}
Are those = 0 neeeded? Am I doing any unneeded copies? Anything that I could write in a more efficient way?