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

Fixes to utilities.cpp and audio_buffer.cpp/h #216

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wardioai
Copy link

utilities.cpp:

  • Shortened modularDistance function

audio_buffer:

  • Corrected typo (checkForDiscontinuitiy -> checkForDiscontinuity)
  • Calculate m_bufferSizeMinusOne outside of for loop to reduce number of computations

@@ -31,7 +31,9 @@ void AudioBuffer::destroy() {
}

bool AudioBuffer::checkForDiscontinuity(int threshold) const {
for (int i = 0; i < m_bufferSize - 1; ++i) {
int i = 0;
int m_bufferSizeMinusOne = m_bufferSize - 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a minor optimization when debugging, but most modern compilers will do this optimization for us. I don't think there's a benefit unless the termination condition includes calling a function.

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.

None yet

2 participants