Skip to content

Conversation

@wakfi
Copy link

@wakfi wakfi commented Sep 7, 2020

I'm don't think a check at the top on max is necessary to enforce it's consistency, but seeing how blatantly unchanging it was I realized that it would be better as an instance variable than a parameter being carried by the function. If you believe it's necessary to have safety check it that's fine, go ahead and add it, but to me it just seemed like an unnecessary extra operation that gets carried at factorial timescale.
I also noticed that in the sort checking portion when sorted is false and a call is made to this.bogoIsSorted, if it returned true the false sorted would still be returned which means the sort would be rechecked all the way up the function stack. I've changed the return to true to resolve this, as returning there means it is sorted.
Thanks for taking a look at this!

@aphitorite aphitorite merged commit c3e3f31 into aphitorite:610 Sep 8, 2020
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