From 9c58cd4817a6deed48f1df45a8933ff88f5fbd4e Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Sat, 1 Oct 2011 17:15:25 +0200 Subject: [PATCH] Don't add a dependency to the array if the array already contains it --- pdf.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdf.js b/pdf.js index 42f272e68..9f8e4c1c1 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]); + } } }