B2G/gaia/apps/homescreen/everything.me/js/api/DoATAPI.js
// not a simple indexOf since a shortcut is either a query or an experienceId
not a simple indexOf since a shortcut is either a query or an experienceId
not a simple indexOf since a shortcut is either a query or an experienceId
function contains(shortcuts, shortcut) {
            if (!shortcuts) {
              return false;
            }
            for (var i=0,shortcutToCheck; shortcutToCheck=shortcuts[i++];) {
                var experienceId1 = shortcutToCheck.experienceId,
                    experienceId2 = shortcut.experienceId,
                    query1 = shortcutToCheck.query,
                    query2 = shortcut.query;
                if ((experienceId1 && experienceId2 && experienceId1 === experienceId2) ||
                    (query1 && query2 && query1 === query2)) {
                    return i-1;
                }
            }
            return false;
        }
function contains ( shortcuts , shortcut ) { if ( ! shortcuts ) { return false ; } for ( var i = 0 , shortcutToCheck ; shortcutToCheck = shortcuts [ i ++ ] ; ) { var experienceId1 = shortcutToCheck . experienceId , experienceId2 = shortcut . experienceId , query1 = shortcutToCheck . query , query2 = shortcut . query ; if ( ( experienceId1 && experienceId2 && experienceId1 === experienceId2 ) || ( query1 && query2 && query1 === query2 ) ) { return i - 1 ; } } return false ; }
not a simple indexOf since a shortcut is either a query or an experienceId
not a simple indexOf since a shortcut is either a query or an experienceId