Though I'm a bit concerned by the names on those variables -- what other horrors lurk further up the file?
Edit: I screwed it up, and the original author probably did too, but I'll stay faithful to the truth table: the value of this.isLoading doesn't matter because || binds tighter than ?:, and it gets or'd with true.
That simplification may change the data type of this.disabled from the OP code, as you are doing simple truthy or falsey checks rather than explicity returning a boolean.
13
u/lanerdofchristian Nov 04 '21 edited Nov 04 '21
I think this would be the simplification?
Though I'm a bit concerned by the names on those variables -- what other horrors lurk further up the file?
Edit: I screwed it up, and the original author probably did too, but I'll stay faithful to the truth table: the value of this.isLoading doesn't matter because || binds tighter than ?:, and it gets or'd with true.
4
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 04 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
3
u/jameswdunne Nov 04 '21
Written to the tune of the leekspin song
1
u/Impossible_Average_1 Nov 04 '21
Do I miss something or will the part after the OR never be evaluated?