Skip to main content

Timeline for Count Consecutive Characters

Current License: CC BY-SA 4.0

13 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited CommunityBot
Commonmark migration
Jul 13, 2018 at 11:58 comment added Arnauld @gastropner Nice catch. Thanks!
Jul 13, 2018 at 11:56 history edited Arnauld CC BY-SA 4.0
saved 2 bytes
Jul 13, 2018 at 11:49 comment added gastropner You can drop m= since m will be zero on first call, and reset to zero by the bit counting. Requires using s for implicit return. This shaves another 2 bytes off.
Jul 12, 2018 at 15:30 comment added ErikF @Arnauld it is (see the note: "[...] The count operand can be an immediate value or register CL. The count is masked to 5 bits, which limits the count range to 0 to 31.")
Jul 12, 2018 at 11:02 comment added Arnauld Actually, I doubt that the compiler would explicitly apply a 5-bit mask. Chances are that this is done at the CPU level.
Jul 12, 2018 at 10:48 comment added Jonathan Frech Because interestingly enough it only appears to wrap when it is computed at runtime. At compile time 1<<32 results in 0 and issues a data type size warning.
Jul 12, 2018 at 6:52 history edited Arnauld CC BY-SA 4.0
minor update
Jul 12, 2018 at 2:25 history edited Arnauld CC BY-SA 4.0
added the commented version
Jul 12, 2018 at 1:50 comment added Arnauld @JonathanFrech I think that's officially undefined behavior. So it must be implementation specific.
Jul 12, 2018 at 1:40 comment added Jonathan Frech Is it implementation specific that 1<<*s wraps or is it standard behaviour?
Jul 12, 2018 at 1:39 history edited Arnauld CC BY-SA 4.0
saved 3 bytes
Jul 12, 2018 at 1:17 history answered Arnauld CC BY-SA 4.0