コード例 #1
0
ファイル: Map.php プロジェクト: scrubmx/collections
 /**
  * @param mixed        $key
  * @param integer      $begin
  * @param integer|null &$insertIndex
  *
  * @return integer|null
  */
 private function binarySearch($key, $begin = 0, &$insertIndex = null)
 {
     $comparator = $this->comparator;
     return Collection::binarySearch($this->elements, array($key, null), function ($lhs, $rhs) use($comparator) {
         return call_user_func($comparator, $lhs[0], $rhs[0]);
     }, $begin, null, $insertIndex);
 }
コード例 #2
0
ファイル: Set.php プロジェクト: scrubmx/collections
 /**
  * @param mixed        $element
  * @param integer      $begin
  * @param integer|null &$insertIndex
  *
  * @return integer|null
  */
 private function binarySearch($element, $begin = 0, &$insertIndex = null)
 {
     return Collection::binarySearch($this->elements, $element, $this->comparator, $begin, null, $insertIndex);
 }