Skip to content

Commit

Permalink
remove own inArray implementation
Browse files Browse the repository at this point in the history
i replaced it with the one from dojo which is significantly faster
  • Loading branch information
exi committed Jun 21, 2011
1 parent 80ec33c commit d3499ea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions phprojekt/application/Default/Views/dojo/scripts/system/phpr.js
Expand Up @@ -1137,12 +1137,11 @@ dojo.declare("phpr.ScrollPane", [dijit.layout._LayoutWidget, dijit._Templated],
});

phpr.inArray = function(needle, haystack) {
var key = '';

for (key in haystack) {
if (haystack[key] === needle) {
return true;
}
//we need to check for this, because for some reason, the function is
//called with undefined as haystack very often

This comment has been minimized.

Copy link
@dsp

dsp Jun 26, 2011

coding style

if("Array" == typeof haystack || "Object" == typeof haystack) {
console.log("use new");
return dojo.indexOf(haystack, needle)!=-1;

This comment has been minimized.

Copy link
@dsp

dsp Jun 26, 2011

coding style

}

return false;
Expand Down

0 comments on commit d3499ea

Please sign in to comment.