3 ms·
Code that test the finite switch: 3. for (int i = 0; i < iteration; i++) { 4. testSwitchFinite(i); 5. } Once i > 5, testSwitchFinite will alway
by wizardofoz 17y ago
Code that test the finite switch:
3. for (int i = 0; i < iteration; i++) {
4. testSwitchFinite(i);
5. }
Once i > 5, testSwitchFinite will always skip to default. This function doesn't even test the switch properly.
Something like testSwitchFinite(i%5+1) would have made more sense (for the finite switch and if-else.)