Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Array.Empty where appropriate #662

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public void NullSafeSet(DbCommand cmd, object value, int index, ISessionImplemen

public SqlType[] SqlTypes
{
get { return new SqlType[] {}; }
get { return Array.Empty<SqlType>(); }
}
public Type ReturnedType => null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ public IType GetPropertyType(string propertyName)

public int[] FindDirty(object[] currentState, object[] previousState, object entity, ISessionImplementor session)
{
return new int[] {};
return Array.Empty<int>();
}

public int[] FindModified(object[] old, object[] current, object entity, ISessionImplementor session)
{
return new int[] {};
return Array.Empty<int>();
}

public object[] GetNaturalIdentifierSnapshot(object id, ISessionImplementor session)
{
return new object[] {};
return Array.Empty<object>();
}

public object Load(object id, object optionalObject, LockMode lockMode, ISessionImplementor session)
Expand All @@ -71,7 +71,7 @@ public void Update(object id, object[] fields, int[] dirtyFields, bool hasDirtyC

public object[] GetDatabaseSnapshot(object id, ISessionImplementor session)
{
return new object[] {};
return Array.Empty<object>();
}

public object GetCurrentVersion(object id, ISessionImplementor session)
Expand Down Expand Up @@ -112,7 +112,7 @@ public object CreateProxy(object id, ISessionImplementor session)

public object[] GetPropertyValuesToInsert(object obj, IDictionary mergeMap, ISessionImplementor session)
{
return new object[] {};
return Array.Empty<object>();
}

public void ProcessInsertGeneratedProperties(object id, object entity, object[] state, ISessionImplementor session)
Expand Down Expand Up @@ -149,7 +149,7 @@ public void SetPropertyValue(object obj, int i, object value, EntityMode entityM

public object[] GetPropertyValues(object obj, EntityMode entityMode)
{
return new object[] {};
return Array.Empty<object>();
}

public object GetPropertyValue(object obj, int i, EntityMode entityMode)
Expand Down Expand Up @@ -353,11 +353,11 @@ public IEntityPersister GetSubclassEntityPersister(object instance, ISessionFact

public string[] PropertySpaces
{
get { return new string[] {}; }
get { return Array.Empty<string>(); }
}
public string[] QuerySpaces
{
get { return new string[] {}; }
get { return Array.Empty<string>(); }
}
public bool IsMutable => false;

Expand All @@ -373,49 +373,49 @@ public string[] QuerySpaces

public int[] NaturalIdentifierProperties
{
get { return new int[] {}; }
get { return Array.Empty<int>(); }
}
public IIdentifierGenerator IdentifierGenerator => null;

public IType[] PropertyTypes
{
get { return new IType[] {}; }
get { return Array.Empty<IType>(); }
}
public string[] PropertyNames
{
get { return new string[] {}; }
get { return Array.Empty<string>(); }
}
public bool[] PropertyInsertability
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public ValueInclusion[] PropertyInsertGenerationInclusions
{
get { return new ValueInclusion[] {}; }
get { return Array.Empty<ValueInclusion>(); }
}
public ValueInclusion[] PropertyUpdateGenerationInclusions
{
get { return new ValueInclusion[] {}; }
get { return Array.Empty<ValueInclusion>(); }
}
public bool[] PropertyCheckability
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public bool[] PropertyNullability
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public bool[] PropertyVersionability
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public bool[] PropertyLaziness
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public CascadeStyle[] PropertyCascadeStyles
{
get { return new CascadeStyle[] {}; }
get { return Array.Empty<CascadeStyle>(); }
}
public IType IdentifierType => null;

Expand Down Expand Up @@ -457,7 +457,7 @@ public CascadeStyle[] PropertyCascadeStyles

public bool[] PropertyUpdateability
{
get { return new bool[] {}; }
get { return Array.Empty<bool>(); }
}
public bool HasCache => false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private object Instantiate(Type type)
if (IsFinderConstructor(constructor))
instance = constructor.Invoke(new[] { this });
else if (IsParameterlessConstructor(constructor))
instance = constructor.Invoke(new object[] { });
instance = constructor.Invoke(Array.Empty<object>());
}

return instance;
Expand Down