From: Julian Viereck Date: Sat, 1 Oct 2011 15:15:25 +0000 (+0200) Subject: Don't add a dependency to the array if the array already contains it X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9c58cd4817a6deed48f1df45a8933ff88f5fbd4e;p=pdf.js.git Don't add a dependency to the array if the array already contains it --- diff --git a/pdf.js b/pdf.js index 42f272e..9f8e4c1 100644 --- a/pdf.js +++ b/pdf.js @@ -4173,7 +4173,10 @@ var PartialEvaluator = (function() { fnArray.push("dependency"); argsArray.push(depList); for (var i = 0; i < depList.length; i++) { - dependency.push(depList[i]); + var dep = depList[i]; + if (dependency.indexOf(dep) == -1) { + dependency.push(depList[i]); + } } }