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

Fix bugs in "indexOfVideoWithSource" #21

Open
feklee opened this issue Jun 3, 2012 · 0 comments
Open

Fix bugs in "indexOfVideoWithSource" #21

feklee opened this issue Jun 3, 2012 · 0 comments

Comments

@feklee
Copy link
Owner

feklee commented Jun 3, 2012

Proposal (return statements originally wrong, and no check if index list is empty):

 // If existent, returns the index of a video clip that shows a transition
 // from the specified configuration. Otherwise returns false.
 function indexOfVideoWithSource(configurationIndex) {
     var sourceConfigurationIndex, indexOfVideo = false;

     $.each(videoIndexesList, function (key, videoIndexes) {
         sourceConfigurationIndex = parseInt(key, 10);
         if (sourceConfigurationIndex === configurationIndex &&
             videoIndexesList[key].length > 0) {
             videoIndexes = videoIndexesList[key]; // non-empty
             indexOfVideo = anyOwnPropertyValue(videoIndexes); // any is OK
             return indexOfVideo;
         }
     });

     return false; // nothing found
 }

Note: This issue may not be relevant anymore - check!

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

No branches or pull requests

1 participant