function batchUpdateAllocPoint(address[] calldata _tokens, uint256[] calldata _allocPoints)
  external
  onlyOwner
{
  if (_tokens.length != _allocPoints.length) revert ArrayLengthMismatch();
  _massUpdatePools();
  uint256 _totalAllocPoint = totalAllocPoint;
  uint256 length = _tokens.length;
  for (uint256 i; i < length; ) {
    VaultInfo storage pool = vaultInfo[_tokens[i]];
    if (pool.lastRewardTime == 0) revert UnknownPool();
    _totalAllocPoint = _totalAllocPoint - pool.allocPoint + _allocPoints[i];
    pool.allocPoint = _allocPoints[i];
    unchecked {
      i++;
    }
  }
  totalAllocPoint = _totalAllocPoint;
  emit BatchAllocPointsUpdated(_tokens, _allocPoints);
}
function _massUpdatePools() internal {
  uint256 totalAP = totalAllocPoint;
  uint256 length = poolLength();
  for (uint256 i; i < length; ) {
    _updatePool(vaultInfo[registeredTokens[i]], totalAP);
    unchecked {
      i++;
    }
  }
  lastAllPoolUpdate = block.timestamp;
}
