Skip to content

Instantly share code, notes, and snippets.

@uploadcare-user
Last active October 24, 2017 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uploadcare-user/7ae06b95a268a700545a8a664de0421d to your computer and use it in GitHub Desktop.
Save uploadcare-user/7ae06b95a268a700545a8a664de0421d to your computer and use it in GitHub Desktop.
Unwrapping loops even further
if (imIn->bands == 4) {
for (xx = 0; xx < imOut->xsize; xx++) {
// Body, 4 channels
}
} else if (imIn->bands == 3) {
for (xx = 0; xx < imOut->xsize; xx++) {
// Body, 3 channels
}
} else {
for (xx = 0; xx < imOut->xsize; xx++) {
// Body, 1 and 2 channels
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment