Skip to content

Update day6_2.rs mod andreselcientifico_david_a_perez - #4

Open
andreselcientifico wants to merge 1 commit into
ThePrimeagen:2022from
andreselcientifico:patch-1
Open

Update day6_2.rs mod andreselcientifico_david_a_perez#4
andreselcientifico wants to merge 1 commit into
ThePrimeagen:2022from
andreselcientifico:patch-1

Conversation

@andreselcientifico

Copy link
Copy Markdown

I made an improvement to David's code that made it more than 3 times faster.

I made an improvement to David's code that made it more than 3 times faster.
@JonathanHallstrom

Copy link
Copy Markdown

have you verified that your code works?

            state |= 1 << bit_idx;
            state & (1 << bit_idx) != 0

correct me if im wrong but it seems like this expression would always evaluate to true?
(if im understanding correctly the compiler seems to agree https://godbolt.org/z/E67x4G85W)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants