3 ms·
unless the consequence itself is something that signifies the end of a basic block, like a break or a next or a return.
by v_ 16y ago
unless the consequence itself is something that signifies the end of a basic block, like a break or a next or a return.
- brianto2010 16y agobacktrack = true unless consequence.signifies? :block_end It doesn't seem that much harder to read.
- draegtun 16y agoUnfortunately though you are potentially adding subtle bugs here which can only be caught at run time. To avoid excessive test coverage it would be more pragmatic to do: backtrack = (consequence.signifies? :block_end) ? false : true But that's not as easy to read :(
- mahmud 16y agoI didn't reply to that one-liner because it is a one-liner. A lot of software engineering lore crumbles into tautologies or is completely obviated when you're working at the microscopic level.