SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages
http://sodium.nz/
Other
848 stars 138 forks source link

Fix inverted logic for --no-shuffle #181

Open almacro opened 10 months ago

almacro commented 10 months ago

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.