imemo9<A, B, C, D, E, F, G, H, I, R> function
Func9<A, B, C, D, E, F, G, H, I, R>
imemo9<A, B, C, D, E, F, G, H, I, R>(
- Func9<
A, B, C, D, E, F, G, H, I, R> func
Checks 9 arguments for equality with identical call and returns cached result if they were not changed.
Implementation
Func9<A, B, C, D, E, F, G, H, I, R> imemo9<A, B, C, D, E, F, G, H, I, R>(
Func9<A, B, C, D, E, F, G, H, I, R> func) {
late A prevArgA;
late B prevArgB;
late C prevArgC;
late D prevArgD;
late E prevArgE;
late F prevArgF;
late G prevArgG;
late H prevArgH;
late I prevArgI;
late R prevResult;
bool isInitial = true;
return ((A argA, B argB, C argC, D argD, E argE, F argF, G argG, H argH,
I argI) {
if (!isInitial &&
identical(argA, prevArgA) &&
identical(argB, prevArgB) &&
identical(argC, prevArgC) &&
identical(argD, prevArgD) &&
identical(argE, prevArgE) &&
identical(argF, prevArgF) &&
identical(argG, prevArgG) &&
identical(argH, prevArgH) &&
identical(argI, prevArgI)) {
return prevResult;
} else {
prevArgA = argA;
prevArgB = argB;
prevArgC = argC;
prevArgD = argD;
prevArgE = argE;
prevArgF = argF;
prevArgG = argG;
prevArgH = argH;
prevArgI = argI;
prevResult = func(argA, argB, argC, argD, argE, argF, argG, argH, argI);
isInitial = false;
return prevResult;
}
});
}