aboutsummaryrefslogtreecommitdiffstats
path: root/data/util.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-02-10 18:24:18 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-02-10 18:24:18 +0100
commit838c1d4abd72bd87dcc8ee41310ca3a8af498c96 (patch)
treef22b0cf123a08fc51c3c779ee5b0971aa2a174c0 /data/util.js
parentba0b4d6110e5b50c15ce722a5a123bcf26bafe3e (diff)
downloadbugzilla-triage-838c1d4abd72bd87dcc8ee41310ca3a8af498c96.tar.gz
All functions should be (theoretically) either working or commented out.
Diffstat (limited to 'data/util.js')
-rw-r--r--data/util.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/data/util.js b/data/util.js
index 7753458..5e8afcc 100644
--- a/data/util.js
+++ b/data/util.js
@@ -192,3 +192,20 @@ function killNodes(doc, target, remove) {
}
});
}
+
+/**
+ * Remove duplicate elements from array
+ *
+ * @param arr Array which needs to be cleaned up
+ * @return cleaned up array
+ */
+function removeDuplicates (arr) {
+ for (var i = 0; i < arr.length; i++) {
+ for (var j = i + 1; j < arr.length; j++) {
+ if (arr[i] == arr[j]) {
+ arr.splice (j, 1);
+ }
+ }
+ }
+ return arr;
+}