private long InternalGetId(object obj, bool assignUniqueIdToValueType, Type type, out bool isNew)
{
if (obj == _previousObj)
{
// good for benchmarks
isNew = false;
return _previousId;
}
_idGenerator._currentCount = _currentId;
if (type != null && type.IsValueType)
{
if (!assignUniqueIdToValueType)
{
isNew = false;
return -1 * _currentId++;
}
}
_currentId++;
long retId = _idGenerator.GetId(obj, out isNew);
_previousObj = obj;
_previousId = retId;
return retId;
}