Internal recursive implementation of minus(K). The value of the removed node is returned via
the 'value' array, if it is non-null.
345371
private HamtPMap<K, V> minus(K key, int hash, V[] value) {
    if (hash == this.hash && key.equals(this.key)) {
      HamtPMap<K, V> result = deleteRoot(mask, children);
      if (value != null) {
        value[0] = this.value;
      }
      return result != null ? result : empty();
    }
    int bucket = bucket(hash);
    int bucketMask = 1 << bucket;
    if ((mask & bucketMask) == 0) {
      // not present, stop looking
      return this;
    }
    hash = shift(hash);
    int index = index(bucketMask);
    HamtPMap<K, V> child = children[index];
    HamtPMap<K, V> newChild = child.minus(key, hash, value);
    if (newChild == child) {
      return this;
    } else if (newChild == EMPTY) {
      return withChildren(mask & ~bucketMask, deleteChild(children, index));
    } else {
      return withChildren(mask, replaceChild(children, index, newChild));
    }
  }
186373
public static SoyValue minus(SoyValue operand0, SoyValue operand1) {
    if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) {
      return IntegerData.forValue(operand0.longValue() - operand1.longValue());
    } else {
      return FloatData.forValue(operand0.numberValue() - operand1.numberValue());
    }
  }
304176
public void remove(int node) {
        if (node == NIL) {
            throw new IllegalArgumentException();
        }
        if (left(node) != NIL && right(node) != NIL) {
            // inner node
            final int next = next(node);
            assert next != NIL;
            swap(node, next);
        }
        assert left(node) == NIL || right(node) == NIL;

        final int parent = parent(node);
        int child = left(node);
        if (child == NIL) {
            child = right(node);
        }

        if (child == NIL) {
            // no children
            if (node == root) {
                assert size() == 1 : size();
                root = NIL;
            } else {
                if (node == left(parent)) {
                    left(parent, NIL);
                } else {
                    assert node == right(parent);
                    right(parent, NIL);
                }
            }
        } else {
            // one single child
            if (node == root) {
                assert size() == 2;
                root = child;
            } else if (node == left(parent)) {
                left(parent, child);
            } else {
                assert node == right(parent);
                right(parent, child);
            }
            parent(child, parent);
        }

        release(node);
        rebalance(parent);
    }
876850
public static void minus(double[] y, double[] x) {
        if (x.length != y.length) {
            throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
        }

        for (int i = 0; i < x.length; i++) {
            y[i] -= x[i];
        }
    }
1030230
public static <T> SortedSet<T> minus(SortedSet<T> self, Iterable<?> removeMe) {
        return (SortedSet<T>) minus((Set<T>) self, removeMe);
    }
885432
@SuppressWarnings("unchecked")
	private void siftDown (int k, E x) {
		int half = size >>> 1; // loop while a non-leaf
		while (k < half) {
			int child = (k << 1) + 1; // assume left child is least
			E c = (E)queue[child];
			int right = child + 1;
			if (right < size && c.compareTo((E)queue[right]) > 0) c = (E)queue[child = right];
			if (x.compareTo(c) <= 0) break;
			queue[k] = c;
			k = child;
		}
		queue[k] = x;
	}
882363
function minus($a) {
    var a = (0, _xvseq._first)($a);
    if (typeof a.neg == "function") return (0, _xvseq.seq)(a.neg());
    return (0, _xvseq.seq)(-a);
}
1236537
public V remove (K key) {
		int hashCode = key.hashCode();
		int index = hashCode & mask;
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		index = hash2(hashCode);
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		index = hash3(hashCode);
		if (key.equals(keyTable[index])) {
			keyTable[index] = null;
			V oldValue = valueTable[index];
			valueTable[index] = null;
			size--;
			return oldValue;
		}

		if (bigTable) {
			index = hash4(hashCode);
			if (key.equals(keyTable[index])) {
				keyTable[index] = null;
				V oldValue = valueTable[index];
				valueTable[index] = null;
				size--;
				return oldValue;
			}
		}

		return removeStash(key);
	}
602618
public void subtract(Object o) {
    Integer count = (Integer) cset.get(o);  
    if ( count != null ) { 
      int c = count.intValue()-1;
      if (c == 0) {
        cset.remove(o);
      }
      else {
        cset.put(o, new Integer(c)); 
      }
    }
  }
149586
public void decreaseValues(int from)
    {
        for (int state = 1; state < getBaseArraySize(); ++state)
        {
            int leaf = getBase(state) + UNUSED_CHAR_VALUE;
            if (1 < leaf && leaf < getCheckArraySize() && getCheck(leaf) == state)
            {
                int value = getLeafValue(getBase(leaf));
                if (value >= from)
                {
                    setBase(leaf, setLeafValue(--value));
                }
            }
        }
    }
619402
function lrem(count, value) {
  var ind, deleted = 0;
  if(count === 0) {
    while((ind = this.indexOf(value)) !== -1) {
      this._data.splice(ind, 1);
      deleted++;
    }
  }else if(count > 0) {
    while((ind = this.indexOf(value)) !== -1 && (deleted < count)) {
      this._data.splice(ind, 1);
      deleted++;
    }
  }else{
    count = Math.abs(count);
    while((ind = this.lastIndexOf(value)) !== -1 && (deleted < count)) {
      this._data.splice(ind, 1);
      deleted++;
    }
  }
  return deleted;
}
581964
static int lowerEdgeIndex( SquareNode node ) {
		for (int i = 0; i < node.square.size(); i++) {
			if( isOpenEdge(node,i) ) {
				int next = addOffset(i,1,node.square.size());
				if( isOpenEdge(node,next)) {
					return i;
				}
				if( i == 0 ) {
					int previous = node.square.size()-1;
					if( isOpenEdge(node,previous)) {
						return previous;
					}
				}
				return i;
			}
		}

		throw new RuntimeException("BUG!");
	}
318222
private void ins(int k)
	{

		//if(last > 0)    last = sapp[-1] += k;
		//else            last = *sapp++ = (k);
		if(last > 0)    last = sapp[sappPos-1]   +=  k;
		else            last = sapp[(sappPos++)]  = (k);
	}
1087140
private int findValue(String s) {

        for (int i = 0; i < values.size(); i++) {
            if (s.equals(values.elementAt(i))) {
                return i;
            }    // end of if (s.equals(values.elementAt(i)))
        }        // end of for (int i=0; i<values.size(); i++)

        return -1;
    }
666583
public static Double smallest(Iterator <Double> elements, int k) {
        if (k <= 0 || !elements.hasNext()) {
            return null;
        } 
        else if (k >= Integer.MAX_VALUE / 2) {
            List <Double> list = new ArrayList <> ();
            while (elements.hasNext()) {
                list.add(elements.next());
            }
            Collections.sort(list);
            return list.get(k - 1);
        }

        int bufferCap = k * 2;
        Double[] buffer = new Double[bufferCap];
        Double threshold = elements.next();
        buffer[0] = threshold;
        int bufferSize = 1;

        while (bufferSize < k && elements.hasNext()) {
            Double e = elements.next();
            buffer[bufferSize++] = e;
            threshold = Math.max(threshold, e);
        }

        while (elements.hasNext()) {
            Double e = elements.next();
            if (e >= threshold) {
                continue;
            }

            buffer[bufferSize++] = e;
            if (bufferSize == bufferCap) {

                int left = 0;
                int right = bufferCap - 1;

                int minThresholdPosition = 0;

                while (left < right) {
                    int pivotIndex = (left + right + 1) >>> 1;
                    
                    //--- partition
                    Double pivotValue = buffer[pivotIndex];

                    buffer[pivotIndex] = buffer[right];
                    buffer[right] = pivotValue;

                    int pivotNewIndex = left;
                    for (int l = left; l < right; l++) {
                        if (buffer[l] < pivotValue) {
                            Double temp = buffer[pivotNewIndex];
                            buffer[pivotNewIndex] = buffer[l];
                            buffer[l] = temp;
                            pivotNewIndex++;
                        }
                    }

                    Double temp = buffer[right];
                    buffer[right] = buffer[pivotNewIndex];
                    buffer[pivotNewIndex] = temp;
                    //---
        
                    if (pivotNewIndex > k) {
                        right = pivotNewIndex - 1;
                    } 
                    else if (pivotNewIndex < k) {
                        left = Math.max(pivotNewIndex, left + 1);
                        minThresholdPosition = pivotNewIndex;
                    } 
                    else {
                        break;
                    }
                }
                bufferSize = k;

                threshold = buffer[minThresholdPosition];
                for (int i = minThresholdPosition + 1; i < bufferSize; i++) {
                    threshold = Math.max(threshold, buffer[i]);
                }
            }
        }
        
        Arrays.sort(buffer, 0, bufferSize);

        k = Math.min(bufferSize, k);
        
        return buffer[k-1];
    }
1078803
private void forceDecreaseKeyToMinimum(Node<K, V> n) {
        Node<K, V> y = n.parent;
        if (y != null) {
            cut(n, y);
            root.mark = false;
            cascadingRankChange(y);
            root = link(root, n);
        }
    }
460403
private final int m() {
		int n = 0;
		int i = k0;
		while (true) {
			if (i > j)
				return n;
			if (!cons(i))
				break;
			i++;
		}
		i++;
		while (true) {
			while (true) {
				if (i > j)
					return n;
				if (cons(i))
					break;
				i++;
			}
			i++;
			n++;
			while (true) {
				if (i > j)
					return n;
				if (!cons(i))
					break;
				i++;
			}
			i++;
		}
	}