Permalink
Browse files

[BUG #4983] Changed the implementation of getCommonParent to not rely…

… on the ObjectRegistry.
  • Loading branch information...
1 parent 710726b commit 95e3fe749764d6c76eff4d666fbcb4060558d15a @wittemann wittemann committed Jan 18, 2012
Showing with 7 additions and 13 deletions.
  1. +7 −13 framework/source/class/qx/dom/Hierarchy.js
@@ -266,33 +266,27 @@ qx.Bootstrap.define("qx.dom.Hierarchy",
return null;
}
else {
- var known = {};
- var obj = qx.core.ObjectRegistry;
- var h1, h2;
+ var known = [];
while (element1 || element2)
{
if (element1)
{
- h1 = obj.toHashCode(element1);
-
- if (known[h1]) {
- return known[h1];
+ if (qx.lang.Array.contains(known, element1)) {
+ return element1;
}
- known[h1] = element1;
+ known.push(element1);
element1 = element1.parentNode;
}
if (element2)
{
- h2 = obj.toHashCode(element2);
-
- if (known[h2]) {
- return known[h2];
+ if (qx.lang.Array.contains(known, element2)) {
+ return element2;
}
- known[h2] = element2;
+ known.push(element2);
element2 = element2.parentNode;
}
}

0 comments on commit 95e3fe7

Please sign in to comment.