/** {@inheritDoc} */
 @SuppressWarnings({"SuspiciousMethodCalls"})
 public boolean retainAll(Collection<?> collection) {
   boolean modified = false;
   TLongIterator iter = iterator();
   while (iter.hasNext()) {
     if (!collection.contains(Long.valueOf(iter.next()))) {
       iter.remove();
       modified = true;
     }
   }
   return modified;
 }
 /** {@inheritDoc} */
 public boolean retainAll(TLongCollection collection) {
   if (this == collection) {
     return false;
   }
   boolean modified = false;
   TLongIterator iter = iterator();
   while (iter.hasNext()) {
     if (!collection.contains(iter.next())) {
       iter.remove();
       modified = true;
     }
   }
   return modified;
 }
  public boolean unload100OldestChunks() {
    int var1;
    // Spout Start
    TLongIterator iterator = this.droppedChunksSet.iterator();
    for (var1 = 0; var1 < 100 && iterator.hasNext(); ++var1) {
      long var2 = iterator.next();
      iterator.remove();
      Chunk var3 = (Chunk) this.chunkMap.func_35578_a(var2);
      var3.onChunkUnload();
      this.func_28062_b(var3);
      this.func_28063_a(var3);
      this.droppedChunksSet.remove(var2);
      this.chunkMap.func_35574_d(var2);
      this.chunkList.remove(var3);
    }
    // Spout End

    for (var1 = 0; var1 < 10; ++var1) {
      if (this.field_35392_h >= this.chunkList.size()) {
        this.field_35392_h = 0;
        break;
      }

      Chunk var4 = (Chunk) this.chunkList.get(this.field_35392_h++);
      EntityPlayer var5 =
          this.worldObj.getClosestPlayer(
              (double) (var4.xPosition << 4) + 8.0D,
              64.0D,
              (double) (var4.zPosition << 4) + 8.0D,
              288.0D);
      if (var5 == null) {
        this.func_35391_d(var4.xPosition, var4.zPosition);
      }
    }

    if (this.chunkLoader != null) {
      this.chunkLoader.func_814_a();
    }

    return this.chunkProvider.unload100OldestChunks();
  }
Beispiel #4
0
  void doFlush(@NotNull DfaVariableValue varPlain, boolean markUnknown) {
    DfaVariableValue varNegated = varPlain.getNegatedValue();

    final int idPlain = varPlain.getID();
    final int idNegated = varNegated == null ? -1 : varNegated.getID();

    int[] classes = myIdToEqClassesIndices.get(idPlain);
    int[] negatedClasses = myIdToEqClassesIndices.get(idNegated);
    int[] result =
        ArrayUtil.mergeArrays(
            ObjectUtils.notNull(classes, ArrayUtil.EMPTY_INT_ARRAY),
            ObjectUtils.notNull(negatedClasses, ArrayUtil.EMPTY_INT_ARRAY));

    int interruptCount = 0;

    for (int varClassIndex : result) {
      EqClass varClass = myEqClasses.get(varClassIndex);
      if ((++interruptCount & 0xf) == 0) {
        ProgressManager.checkCanceled();
      }

      varClass = new EqClass(varClass);
      myEqClasses.set(varClassIndex, varClass);
      for (int id : varClass.toNativeArray()) {
        int idUnwrapped;
        if (id == idPlain
            || id == idNegated
            || (idUnwrapped = unwrap(myFactory.getValue(id)).getID()) == idPlain
            || idUnwrapped == idNegated) {
          varClass.removeValue(id);
        }
      }

      if (varClass.isEmpty()) {
        myEqClasses.set(varClassIndex, null);

        for (TLongIterator iterator = myDistinctClasses.iterator(); iterator.hasNext(); ) {
          long pair = iterator.next();
          if (low(pair) == varClassIndex || high(pair) == varClassIndex) {
            iterator.remove();
          }
        }
      } else if (varClass.containsConstantsOnly()) {
        for (TLongIterator iterator = myDistinctClasses.iterator(); iterator.hasNext(); ) {
          long pair = iterator.next();
          if (low(pair) == varClassIndex && myEqClasses.get(high(pair)).containsConstantsOnly()
              || high(pair) == varClassIndex
                  && myEqClasses.get(low(pair)).containsConstantsOnly()) {
            iterator.remove();
          }
        }
      }
    }

    removeAllFromMap(idPlain);
    removeAllFromMap(idNegated);
    myVariableStates.remove(varPlain);
    if (varNegated != null) {
      myVariableStates.remove(varNegated);
    }
    if (markUnknown) {
      myUnknownVariables.add(varPlain);
    }
    myCachedNonTrivialEqClasses = null;
    myCachedDistinctClassPairs = null;
    myCachedHash = null;
  }