Timeline for Is there a way to have four possible outcomes without repeating the two conditions?
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 20, 2017 at 22:11 | vote | accept | Kyle Delaney | ||
| Aug 19, 2017 at 8:00 | comment | added | Christophe | Nice answer for the general case! But for the OP's specific case, this supposes that a() has no side effect on q. And trades 2 show ups of q in the original source code against to show ups of a() in your proposal (being understood that in both cases the execution path will only make use of one, and for the OP it seems to be only a matter of avoiding duplication in the source code). | |
| Aug 18, 2017 at 23:51 | history | edited | John Wu | CC BY-SA 3.0 | added 678 characters in body |
| Aug 18, 2017 at 23:46 | history | edited | John Wu | CC BY-SA 3.0 | added 678 characters in body |
| Aug 18, 2017 at 23:39 | history | edited | John Wu | CC BY-SA 3.0 | added 709 characters in body |
| Aug 18, 2017 at 23:37 | comment | added | Frank Hileman | Might be nice to show the enum containing the bits. | |
| Aug 18, 2017 at 22:44 | history | edited | John Wu | CC BY-SA 3.0 | added 330 characters in body |
| Aug 18, 2017 at 22:38 | history | edited | John Wu | CC BY-SA 3.0 | added 330 characters in body |
| Aug 18, 2017 at 22:32 | history | answered | John Wu | CC BY-SA 3.0 |