takeBackControlInterpolant method

dynamic takeBackControlInterpolant(
  1. dynamic interpolant
)

Implementation

takeBackControlInterpolant(interpolant) {
  var interpolants = _controlInterpolants,
      prevIndex = interpolant.__cacheIndex,
      firstInactiveIndex = --_nActiveControlInterpolants,
      lastActiveInterpolant = interpolants[firstInactiveIndex];

  interpolant.__cacheIndex = firstInactiveIndex;
  interpolants[firstInactiveIndex] = interpolant;

  lastActiveInterpolant.__cacheIndex = prevIndex;
  interpolants[prevIndex] = lastActiveInterpolant;
}