The Wayback Machine - https://web.archive.org/web/20201205030839/https://github.com/orbitdb/ipfs-log/issues/263
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

Incorrect log-sorting.js docstrings #263

Open
frnsskk opened this issue Aug 16, 2019 · 0 comments
Open

Incorrect log-sorting.js docstrings #263

frnsskk opened this issue Aug 16, 2019 · 0 comments

Comments

@frnsskk
Copy link

@frnsskk frnsskk commented Aug 16, 2019

I'm currently making a Rust port of IPFS log, and I noticed that the docstring return values in log-sorting.js are incorrect:

  1. It is claimed @returns {number} 1 if a is greater, -1 if b is greater when actually it is the other way around.
  2. SortByClocks is claimed to return 1 or -1 (in the manner stated above), but in reality it returns the time difference between the two clocks, which can potentially be any signed integer. (Naturally and fortunately though, this doesn't affect its behavior as a sorting compare function, which it is used as.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.