System.Runtime.Serialization.Formatters.Binary.ObjectWriter.InternalGetId C# (CSharp) Method

InternalGetId() private method

private InternalGetId ( object obj, bool assignUniqueIdToValueType, Type type, bool &isNew ) : long
obj object
assignUniqueIdToValueType bool
type System.Type
isNew bool
return long
        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;
        }