summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/jscripts
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2014-10-23 11:13:05 +0000
committeririna <irinagomez@us.es>2014-10-23 11:13:05 +0000
commit1de07b8ab5806d8daa2fe7a31501a32cbde8a018 (patch)
treee51bb92382fc913e7999bdc4a939e8cf99c56544 /admin/WebConsole/jscripts
parentcd86637886efa13643903f464a4ac6274d25812c (diff)
#665 IniciarSesion: envia accion a los equipos comunes entre la seleccion de la configuración y el filtro.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4409 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/jscripts')
-rw-r--r--admin/WebConsole/jscripts/arrays.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/WebConsole/jscripts/arrays.js b/admin/WebConsole/jscripts/arrays.js
new file mode 100644
index 00000000..4af858f6
--- /dev/null
+++ b/admin/WebConsole/jscripts/arrays.js
@@ -0,0 +1,30 @@
+/// @file arrays.js
+/// @brief: implementa funciones de uso común para arrays.
+/// @date: 2014-10-23
+
+/// @function array_interset
+/// @brief Devuelve un array con los elementos comunes a los dos arrays iniciales.
+/// @brief Los arrays deben estar ordenados.
+/// @param 1 {Array} array ordenado.
+/// @param 2 {Array} array ordenado.
+/// @return {Array} array con elementos comunes.
+/// @date: 2014-10-23
+function array_interset (a, b) {
+ var ai=0, bi=0;
+ var result = new Array();
+ while( ai < a.length && bi < b.length )
+ if (a[ai] < b[bi] ){ ai++; }
+ else if (a[ai] > b[bi] ){ bi++; }
+ else /* they're equal */
+ {
+ result.push(a[ai]);
+ ai++;
+ bi++;
+ }
+ return result;
+}
+
+
+
+
+