rem: for( var i = 0; i < node.childNodes.length; i++ ) { var currItem = node.childNodes[i]; dump("*** chain = " + chain[chain.length-1] + "\n"); if( !currItem.getAttribute("name").indexOf( aMatchString ) ) { 
add:  var totalItems = node.childNodes.length; if (totalItems == 0) return; var lastLow = 0; var lastHigh = totalItems; while (true) { var i = Math.floor((lastHigh + lastLow) / 2);  var currItem = node.childNodes[i]; var currValue = (currItem.getAttribute("name")).substring(0,aMatchString.length);  if (currValue > aMatchString) { if (lastHigh == i) return; lastHigh = i; } else if (currValue < aMatchString) { if (lastLow == i) return; lastLow = i; } else { 
context: function selectNodeByName( aMatchString ){  var lastDot = aMatchString.lastIndexOf(gFolderDelimiter);  var nodeValue = lastDot != -1 ? aMatchString.substring(0, lastDot) : aMatchString;    var chain = aMatchString.split(gFolderDelimiter);  if( chain.length == 1 ) {    var node = getTreechildren(gSubscribeTree);    if( !node )      return;  }  else {    var node = gSubscribeTree.getElementsByAttribute("name",nodeValue)[0];    if( node.getAttribute("container") == "true" &&         node.getAttribute("open") != "true" )      node.setAttribute("open","true");    node = getTreechildren(node);    dump("*** node = " + node.localName + "\n");  }    for( var i = 0; i < node.childNodes.length; i++ )  {    var currItem = node.childNodes[i];    dump("*** chain = " + chain[chain.length-1] + "\n");    if( !currItem.getAttribute("name").indexOf( aMatchString ) ) {      gSubscribeTree.selectItem( currItem );      gSubscribeTree.ensureElementIsVisible( currItem );      return;    }  }      }
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/5dff1d6e3ba7c2850d61a0144a19da8ac13dcbd6/subscribe.js/buggy/mailnews/base/resources/content/subscribe.js