Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inverted logic for --no-shuffle #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

almacro
Copy link

@almacro almacro commented Sep 8, 2023

This revision fixes an apparent inverted logic bug in processing of the "--no-shuffle" option.

The text describes the linked-list program timing with/without the option as:

time ./linked-list --no-shuffle
user 0m3.390s

time ./linked-list
user 1m19.563s

However we saw the behavior as inverse, e.g.:

$ time ./linked-list --no-shuffle

real	1m24.075s
user	1m24.054s
sys	0m0.020s

$ time ./linked-list

real	0m3.724s
user	0m3.708s
sys	0m0.017s

Prior to this fix, including the "--no-shuffle" option would make the program shuffle list entries, which was the opposite of the intended effect.

This revision also adds an include for the string header as needed for strcmp to work correctly in GCC. This was tested with GCC 7.5.0 on Ubuntu 18.04.6 LTS.

This revision fixes an apparent inverted logic bug in processing of the "--no-shuffle" option.

The [text](https://freecontent.manning.com/wp-content/uploads/functional-reactive-programming-in-search-of-the-mythical-von-neumann-machine.pdf) describes the `linked-list` program timing with/without the option as:

```
time ./linked-list --no-shuffle
user 0m3.390s

time ./linked-list
user 1m19.563s
```

However we saw the behavior as inverse, e.g.:

```
$ time ./linked-list --no-shuffle

real	1m24.075s
user	1m24.054s
sys	0m0.020s

$ time ./linked-list

real	0m3.724s
user	0m3.708s
sys	0m0.017s
```

Prior to this fix, including the "--no-shuffle" option would make the program shuffle list entries,
which was the opposite of the intended effect.

This revision also adds an include for the string header as needed for `strcmp` to work correctly in GCC.
This was tested with GCC 7.5.0 on Ubuntu 18.04.6 LTS.
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.

1 participant