Skip to content

Conversation

@spfetsch
Copy link

Existing median implementation assumed a given list of samples was sorted, but
the callers did not sort. Added a sort utility function and sorted the samples
before each use of the median function.

Existing median implementation assumed a given list of samples was sorted, but
the callers did not sort. Added a sort utility function and sorted the samples
before each use of the median function.
@kamrik
Copy link
Contributor

kamrik commented May 11, 2016

Oops, that's an important bug. Thanks!
I'll go with copy + sort inside the median function rather than sorting each time before. Speed is not very important here since we never use the median on large arrays. But printing the lists in the original order into the log is important because one might want to check the numbers against earlier verbose sections of the log per event.

@kamrik kamrik closed this in 517d2e1 May 11, 2016
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